|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.anidb.checksum.Checksum
public abstract class Checksum
The super class of all checksum / hash classes.
Constructor Summary | |
---|---|
Checksum()
Creates a checksum object. |
Method Summary | |
---|---|
abstract byte[] |
getDigest()
Builds and returns the digest. |
java.lang.String |
getHexDigest()
Calls getDigest() and returns the digest into a hex format. |
abstract void |
reset()
Resets the checksum object. |
abstract void |
update(byte[] buf,
int off,
int len)
Updates the checksum with data. |
abstract void |
update(int data)
Updates the checksum with data. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Checksum()
Method Detail |
---|
public abstract byte[] getDigest()
Builds and returns the digest.
After calling this method you have to use reset()
.
reset()
,
getHexDigest()
public java.lang.String getHexDigest()
getDigest()
and returns the digest into a hex format.
getDigest()
public abstract void reset()
public abstract void update(byte[] buf, int off, int len)
buf
- The data buffer.off
- The offset.len
- The length.
java.lang.IllegalArgumentException
- If the data buffer is null
.
java.lang.IllegalArgumentException
- If the offset is less than 0.
java.lang.IllegalArgumentException
- If the length is less than 1.
java.lang.IllegalArgumentException
- If the offset + the length is greater
than the length of the data buffer.public abstract void update(int data)
data
- The data.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |