Package dev.zarr.zarrjava.utils
Class CRC32C
java.lang.Object
dev.zarr.zarrjava.utils.CRC32C
- All Implemented Interfaces:
Checksum
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetValue()Returns the value of the checksum.byte[]Returns the value of the checksum.voidreset()Resets the crc.voidupdate(byte[] bArray, int off, int len) Updates the checksum with an array of bytes.voidupdate(int b) Updates the checksum with a new byte.voidupdate(ByteBuffer buf)
-
Constructor Details
-
CRC32C
public CRC32C()
-
-
Method Details
-
update
public void update(int b) Updates the checksum with a new byte. -
update
public void update(byte[] bArray, int off, int len) Updates the checksum with an array of bytes. -
update
-
getValue
public long getValue()Returns the value of the checksum. -
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.
-