|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.util.MD5
public final class MD5
A 16 byte hash that uniquely identifies content across space and time
| Nested Class Summary | |
|---|---|
static class |
MD5.Stream
The MD5 of content digested from a stream, computed after the stream is closed |
| Constructor Summary | |
|---|---|
MD5()
Construct an MD5 |
|
MD5(byte[] aSourceBytes)
This constructor is expecting (previously computed) MD5 bytes themselves. |
|
MD5(MD5 aMD5)
Construct an MD5 from another |
|
MD5(java.lang.String stringMD5)
Construct a new MD5 with the given String value. |
|
| Method Summary | |
|---|---|
void |
computeBufferMD5(byte[] data)
Compute MD5 for a byte array. |
long |
computeFileMD5(java.io.File file)
Compute MD5 on a file and return file length. |
long |
computeStreamMD5(java.io.InputStream in)
Compute MD5 on a file and return file length. |
boolean |
equals(java.lang.Object obj)
Return true if the given byte[] is identical to this object. |
byte[] |
getData()
Return the byte[] of this object's value. |
int |
hashCode()
Return a hashcode for this MD5 value. |
void |
setData(byte[] aSource)
set the data (payload) of an MD5 - this is a precomputed MD5 byte array |
java.lang.String |
toHexString()
Return the a 32-character String equal to the hex equivalent of this MD5 value. |
java.lang.String |
toString()
returns a quasi-readable string representation of this MD5 |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MD5()
public MD5(byte[] aSourceBytes)
aSourceBytes - byte[] from previously computed MD5 bytespublic MD5(MD5 aMD5)
aMD5 - another MD5public MD5(java.lang.String stringMD5)
stringMD5 - A 32-character hex value of an MD5 value.
java.lang.IllegalArgumentException - If the given value is not 32 characters.
NumberFormatExcpetion - If the given value does not contain all hexadecimal
characters (a-z, A-Z, or 0-9).| Method Detail |
|---|
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - Object to be compared.
public void computeBufferMD5(byte[] data)
data - the byte[] to compute and encode into an MD5public java.lang.String toHexString()
public java.lang.String toString()
toString in class java.lang.Object
public long computeStreamMD5(java.io.InputStream in)
throws java.io.IOException
in - an input stream
java.io.IOException
public long computeFileMD5(java.io.File file)
throws java.io.IOException
file - the file whose md5 is to be computed
java.io.IOExceptionpublic byte[] getData()
public void setData(byte[] aSource)
aSource - the MD5
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||