|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A general interface for 32-bit checksums that have the "rolling" property.
| Method Summary | |
|---|---|
void |
check(byte[] buf,
int offset,
int length)
Replaces the current internal state with entirely new data. |
Object |
clone()
Copies this checksum instance into a new instance. |
boolean |
equals(Object o)
Tests if a particular checksum is equal to this checksum. |
int |
getValue()
Returns the currently-computed 32-bit checksum. |
void |
reset()
Resets the internal state of the checksum, so it may be re-used later. |
void |
roll(byte bt)
Update the checksum with a single byte. |
void |
trim()
Update the checksum by simply "trimming" the least-recently-updated byte from the internal state. |
| Method Detail |
public int getValue()
public void reset()
public void roll(byte bt)
bt - The next byte.public void trim()
public void check(byte[] buf,
int offset,
int length)
buf - The bytes to checksum.offset - The offset into buf to start reading.length - The number of bytes to update.public Object clone()
Cloneable interface.
public boolean equals(Object o)
equals in class Objecto - The object to test.
true if this checksum equals the other
checksum.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||