Class CRC32C

java.lang.Object
dev.zarr.zarrjava.utils.CRC32C
All Implemented Interfaces:
Checksum

public class CRC32C extends Object implements Checksum
  • Constructor Details

    • CRC32C

      public CRC32C()
  • Method Details

    • update

      public void update(int b)
      Updates the checksum with a new byte.
      Specified by:
      update in interface Checksum
      Parameters:
      b - the new byte.
    • update

      public void update(byte[] bArray, int off, int len)
      Updates the checksum with an array of bytes.
      Specified by:
      update in interface Checksum
      Parameters:
      bArray - the array of bytes.
      off - the offset into the array where the update should begin.
      len - the length of data to examine.
    • update

      public void update(ByteBuffer buf)
    • getValue

      public long getValue()
      Returns the value of the checksum.
      Specified by:
      getValue in interface Checksum
      Returns:
      the long representation of the checksum (high bits set to zero).
    • getValueAsBytes

      public byte[] getValueAsBytes()
      Returns the value of the checksum.
      Returns:
      the 4-byte array representation of the checksum in network byte order (big endian).
    • reset

      public void reset()
      Resets the crc.
      Specified by:
      reset in interface Checksum