java.lang.Object
org.seppiko.commons.utils.crypto.CRC16MAXIM
- All Implemented Interfaces:
Checksum
A class that can be used to compute the CRC-16 of a data stream. With MAXIM
- Author:
- Leonard Woo
-
Constructor Details
-
CRC16MAXIM
public CRC16MAXIM()Create CRC-16 object
-
-
Method Details
-
update
public void update(int b) Updates the CRC-16 checksum with the specified byte. -
update
public void update(byte[] b, int off, int len) throws NullPointerException, ArrayIndexOutOfBoundsException Updates the CRC-16 checksum with the specified array of bytes.- Specified by:
updatein interfaceChecksum- Parameters:
b- dataoff- data init offsetlen- data length- Throws:
NullPointerException- data is nullArrayIndexOutOfBoundsException- if off is negative, or len is negative, or off+len is negative or greater than the length of the array b
-
getValue
public long getValue()Returns CRC-16 value. -
reset
public void reset()Resets CRC-16 to initial value.
-