Class RpcCRC32Checksum
java.lang.Object
java.util.zip.CRC32
com.perforce.p4java.impl.mapbased.rpc.sys.RpcCRC32Checksum
- All Implemented Interfaces:
Checksum
Provides a wrapper to the basic Java CRC32 to allow us to use the JZlib pure
Java implementation of the CRC32 checksum from RFC1952.
This avoids the basic Java CRC32's JNI overhead for certain uses of checksumming where many small pieces of data are checksummed in succession.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetValue()Returns CRC-32 value.voidreset()Resets Rpc CRC-32 to initial value.voidupdate(byte[] b) Updates the Rpc CRC-32 checksum with the specified array of bytes.voidupdate(byte[] b, int off, int len) Updates the Rpc CRC-32 checksum with the specified array of bytes.voidupdate(int b) Updates the Rpc CRC-32 checksum with the specified byte (the low eight bits of the argument b).
-
Constructor Details
-
RpcCRC32Checksum
public RpcCRC32Checksum()Creates a new RpcCRC32Checksum object.
-
-
Method Details
-
update
public void update(int b) Updates the Rpc CRC-32 checksum with the specified byte (the low eight bits of the argument b). -
update
public void update(byte[] b, int off, int len) Updates the Rpc CRC-32 checksum with the specified array of bytes. -
update
public void update(byte[] b) Updates the Rpc CRC-32 checksum with the specified array of bytes.- Parameters:
b- the array of bytes to update the checksum with
-
reset
public void reset()Resets Rpc CRC-32 to initial value. -
getValue
public long getValue()Returns CRC-32 value.
-