|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.io.MD5Hash
public class MD5Hash
A Writable for MD5 hash values.
| Nested Class Summary | |
|---|---|
static class |
MD5Hash.Comparator
A WritableComparator optimized for MD5Hash keys. |
| Field Summary | |
|---|---|
static int |
MD5_LEN
|
| Constructor Summary | |
|---|---|
MD5Hash()
Constructs an MD5Hash. |
|
MD5Hash(byte[] digest)
Constructs an MD5Hash with a specified value. |
|
MD5Hash(String hex)
Constructs an MD5Hash from a hex string. |
|
| Method Summary | |
|---|---|
int |
compareTo(Object o)
Compares this object with the specified object for order. |
static MD5Hash |
digest(byte[] data)
Construct a hash value for a byte array. |
static MD5Hash |
digest(byte[] data,
int start,
int len)
Construct a hash value for a byte array. |
static MD5Hash |
digest(String string)
Construct a hash value for a String. |
static MD5Hash |
digest(Text text)
Construct a hash value for a String. |
boolean |
equals(Object o)
Returns true iff o is an MD5Hash whose digest contains the
same values. |
byte[] |
getDigest()
Returns the digest bytes. |
long |
halfDigest()
Construct a half-sized version of this MD5. |
int |
hashCode()
Returns a hash code value for this object. |
static MD5Hash |
read(DataInput in)
Constructs, reads and returns an instance. |
void |
readFields(DataInput in)
Reads the fields of this object from in. |
void |
set(MD5Hash that)
Copy the contents of another instance into this instance. |
void |
setDigest(String hex)
Sets the digest value from a hex string. |
String |
toString()
Returns a string representation of this object. |
void |
write(DataOutput out)
Writes the fields of this object to out. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MD5_LEN
| Constructor Detail |
|---|
public MD5Hash()
public MD5Hash(String hex)
public MD5Hash(byte[] digest)
| Method Detail |
|---|
public void readFields(DataInput in)
throws IOException
Writablein. For efficiency,
implementations should attempt to re-use storage in the existing object
where possible.
readFields in interface WritableIOException
public static MD5Hash read(DataInput in)
throws IOException
IOException
public void write(DataOutput out)
throws IOException
Writableout.
write in interface WritableIOExceptionpublic void set(MD5Hash that)
public byte[] getDigest()
public static MD5Hash digest(byte[] data)
public static MD5Hash digest(byte[] data,
int start,
int len)
public static MD5Hash digest(String string)
public static MD5Hash digest(Text text)
public long halfDigest()
public boolean equals(Object o)
o is an MD5Hash whose digest contains the
same values.
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic int compareTo(Object o)
compareTo in interface Comparablepublic String toString()
toString in class Objectpublic void setDigest(String hex)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||