Checksum: reset() : Checksum « java.util.zip « Java by API






Checksum: reset()

 

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

public class Main {
  public static void main(String[] argv) throws Exception {
    byte[] bytes = "some data".getBytes();

    // Compute Adler-32 checksum
    Checksum checksumEngine = new CRC32();
    checksumEngine.update(bytes, 0, bytes.length);
    long checksum = checksumEngine.getValue();

    checksumEngine.reset();
  }
}

   
  








Related examples in the same category

1.implements Checksum
2.Checksum: getValue()
3.Checksum: update(int b)