|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.uiuc.ndiipp.hubandspoke.utils.HaSChecksummer
public class HaSChecksummer
Gives us checksums!
To be used in conjunction with a CheckedInputStream. Digests are computed as bytes are read from the stream.
For example:
HaSChecksummer summer = new HaSChecksummer();
File temp = readFile(new CheckedInputStream(new FileInputStream("/var/temp/file"), summer));
| Constructor Summary | |
|---|---|
HaSChecksummer()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getBase64EncodedMD5()
Returns the value of the MD5 digest as a Base64 encoded string. |
java.lang.String |
getBase64EncodedSHA1()
Returns the value of the SHA1 digest as a Base64 encoded string. |
java.util.zip.CRC32 |
getCRC32()
|
java.lang.String |
getHexEncodedMD5()
Returns the value of the MD5 digest as a Hex encoded string. |
java.lang.String |
getHexEncodedSHA1()
Returns the value of the SHA1 digest as a Hex encoded string. |
long |
getLongCRC32()
Returns the value of the CRC32 checksum as a long. |
java.security.MessageDigest |
getMd5Digest()
Getter for the raw MD5 Digest |
java.security.MessageDigest |
getSha1Digest()
Getter for the raw SHA1 digest |
long |
getValue()
|
void |
reset()
clear! |
void |
update(byte b)
Updates the checksum with the argument. |
void |
update(byte[] b)
Updates the checksum with the argument. |
void |
update(byte[] b,
int off,
int len)
Updates the checksum with the argument. |
void |
update(int b)
Updates the checksum with the argument. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HaSChecksummer()
| Method Detail |
|---|
public java.util.zip.CRC32 getCRC32()
public java.security.MessageDigest getMd5Digest()
public java.security.MessageDigest getSha1Digest()
public long getValue()
getValue in interface java.util.zip.Checksumpublic void reset()
reset in interface java.util.zip.Checksumpublic void update(byte b)
public void update(int b)
update in interface java.util.zip.Checksumpublic void update(byte[] b)
public void update(byte[] b,
int off,
int len)
update in interface java.util.zip.Checksumpublic java.lang.String getBase64EncodedMD5()
public java.lang.String getBase64EncodedSHA1()
public java.lang.String getHexEncodedMD5()
public java.lang.String getHexEncodedSHA1()
public long getLongCRC32()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||