|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.io.UTF8
public class UTF8
A WritableComparable for strings that uses the UTF8 encoding.
Also includes utilities for efficiently reading and writing UTF-8.
| Nested Class Summary | |
|---|---|
static class |
UTF8.Comparator
Deprecated. A WritableComparator optimized for UTF8 keys. |
| Constructor Summary | |
|---|---|
UTF8()
Deprecated. |
|
UTF8(java.lang.String string)
Deprecated. Construct from a given string. |
|
UTF8(UTF8 utf8)
Deprecated. Construct from a given string. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object o)
Deprecated. Compare two UTF8s. |
boolean |
equals(java.lang.Object o)
Deprecated. Returns true iff o is a UTF8 with the same contents. |
byte[] |
getBytes()
Deprecated. The raw bytes. |
static byte[] |
getBytes(java.lang.String string)
Deprecated. Convert a string to a UTF-8 encoded byte array. |
int |
getLength()
Deprecated. The number of bytes in the encoded string. |
int |
hashCode()
Deprecated. |
void |
readFields(java.io.DataInput in)
Deprecated. Deserialize the fields of this object from in. |
static java.lang.String |
readString(java.io.DataInput in)
Deprecated. Read a UTF-8 encoded string. |
void |
set(java.lang.String string)
Deprecated. Set to contain the contents of a string. |
void |
set(UTF8 other)
Deprecated. Set to contain the contents of a string. |
static void |
skip(java.io.DataInput in)
Deprecated. Skips over one UTF8 in the input. |
java.lang.String |
toString()
Deprecated. Convert to a String. |
void |
write(java.io.DataOutput out)
Deprecated. Serialize the fields of this object to out. |
static int |
writeString(java.io.DataOutput out,
java.lang.String s)
Deprecated. Write a UTF-8 encoded string. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UTF8()
public UTF8(java.lang.String string)
public UTF8(UTF8 utf8)
| Method Detail |
|---|
public byte[] getBytes()
public int getLength()
public void set(java.lang.String string)
public void set(UTF8 other)
public void readFields(java.io.DataInput in)
throws java.io.IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface Writablein - DataInput to deseriablize this object from.
java.io.IOException
public static void skip(java.io.DataInput in)
throws java.io.IOException
java.io.IOException
public void write(java.io.DataOutput out)
throws java.io.IOException
Writableout.
write in interface Writableout - DataOuput to serialize this object into.
java.io.IOExceptionpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
o is a UTF8 with the same contents.
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static byte[] getBytes(java.lang.String string)
String.getBytes(String)
public static java.lang.String readString(java.io.DataInput in)
throws java.io.IOException
java.io.IOExceptionDataInput.readUTF()
public static int writeString(java.io.DataOutput out,
java.lang.String s)
throws java.io.IOException
java.io.IOExceptionDataOutput.writeUTF(String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||