获取CRC

欢马劈雪     最近更新时间:2020-01-02 10:19:05

589
获取邮编的CRC-32校验和
//时 代 J a v a - nowjava.com 提 供


import java.io.IOException;

import java.util.Enumeration;

import java.util.zip.ZipEntry;

import java.util.zip.ZipFile;


public class Main {


  public static void main(String args[]) {

    try {

      ZipFile zipFile = new ZipFile("c:/Folder/WebFiles.zip");

      Enumeration e = zipFile.entries();


      System.out.print("File Name");

      System.out.print("\t\t\t\tCRC-32 Checksum");

      /**
       from
      * 时代Java公众号 
      **/

      while (e.hasMoreElements()) {

        ZipEntry entry = (ZipEntry) e.nextElement();


        String entryName = entry.getName();

        long crc = entry.getCrc();


        System.out.print(entryName);

        System.out.print("\t\t\t\t" + crc);

        System.out.print(
展开阅读全文