Code example for Checksum

Methods: getValuereset

  /* verify checksum for the chunk. 
   * @throws ChecksumException if there is a mismatch 
  private void verifySum(long errPos) throws ChecksumException {
    long crc = getChecksum();
    long sumValue = sum.getValue();
    if (crc != sumValue) {
      throw new ChecksumException( 
          "Checksum error: "+file+" at "+errPos, errPos);
  /* calculate checksum value */ 
  private long getChecksum() { 
    return checksum2long(checksum);
  /** Convert a checksum byte array to a long */ 
  static public long checksum2long(byte[] checksum) {
Contextual code suggestions in your IDE  Get Codota for Java