private static int fastComputeChecksum(byte[] buffer,int offset,int length,int initValue,int mask) throws NoSuchAlgorithmException {
  AbstractChecksum checksum;
  checksum=JacksumAPI.getChecksumInstance("crc:16," + Integer.toHexString(mask) + ","+ Integer.toHexString(initValue)+ ",false,false,0");
  checksum.reset();
  checksum.update(buffer,offset,length);
  return (int)checksum.getValue();
}

private static int fastComputeChecksum ( byte [ ] buffer , int offset , int length , int initValue , int mask ) throws NoSuchAlgorithmException { AbstractChecksum checksum ; checksum = JacksumAPI . getChecksumInstance ( "crc:16," + Integer . toHexString ( mask ) + "," + Integer . toHexString ( initValue ) + ",false,false,0" ) ; checksum . reset ( ) ; checksum . update ( buffer , offset , length ) ; return ( int ) checksum . getValue ( ) ; }
optimized implementation using jacksum . just faster .
