|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.cs.ohtu.mpeg2.util.CRC16
public class CRC16
A class for computing CRC-16 checksums. The generator polynomial is x^16 + x^15 + x^2 + 1.
Field Summary | |
---|---|
private static int |
CRC16_POLY
|
private int |
reg
|
Constructor Summary | |
---|---|
CRC16()
Creates a new CRC-16 instance. |
Method Summary | |
---|---|
long |
getValue()
Returns CRC-16 value. |
void |
reset()
Resets CRC-16 to the initial value. |
void |
update(byte[] b)
Updates CRC-16 with specified array of bytes. |
void |
update(byte[] b,
int off,
int len)
Updates CRC-16 with specified array of bytes. |
void |
update(int b)
Updates CRC-16 with specified byte. |
void |
updateBit(int b)
Updates CRC-16 with specified bit. |
void |
updateBits(int word,
int len)
Updates CRC-16 with specified bits. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int CRC16_POLY
private int reg
Constructor Detail |
---|
public CRC16()
Method Detail |
---|
public long getValue()
getValue
in interface java.util.zip.Checksum
public void reset()
reset
in interface java.util.zip.Checksum
public void update(byte[] b, int off, int len)
update
in interface java.util.zip.Checksum
b
- The array of bytes to update the checksum withoff
- The start offset of the datalen
- The number of bytes to usepublic void update(byte[] b)
b
- The array of bytes to update the checksum withpublic void update(int b)
update
in interface java.util.zip.Checksum
b
- The byte to update the checksum withpublic void updateBit(int b)
b
- The bit to update the checksum withpublic void updateBits(int word, int len)
word
- The bits to update the checksum withlen
- The number of the least significant bits to use
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |