java.util.zip. CRC32.update2() 方法示例


java.util.zip. CRC32.update2() 方法示例

package com.codingdict;

import java.util.zip.CRC32;
import java.util.zip.Checksum;

public class CRC32Demo {
   public static void main(String[] args) {
      int bytes = 55;

      Checksum checksum = new CRC32();
      checksum.reset();       

      checksum.update(bytes);
      long checksumValue = checksum.getValue();

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