JavaZip CRC32.reset() 方法


JavaZip CRC32.reset() 方法

package com.codingdict;



import java.util.zip.CRC32;

import java.util.zip.Checksum;



public class CRC32Demo {



   public static void main(String[] args) {

      String message = "Welcome to codingdict.com";

      byte bytes[] = message.getBytes();

      Checksum checksum = new CRC32();

      checksum.reset();       

      checksum.update(bytes,0,bytes.length);

      long checksumValue = checksum.getValue();

      System.out.println("CRC32 checksum :" + checksumValue);

   }

}