|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.util.Utf8
public class Utf8
A Utf8 string. Unlike String
, instances are mutable. This is more
efficient than String
when reading or writing a sequence of values,
as a single instance may be reused.
Constructor Summary | |
---|---|
Utf8()
|
|
Utf8(byte[] bytes)
|
|
Utf8(String string)
|
Method Summary | |
---|---|
char |
charAt(int index)
|
int |
compareTo(Utf8 that)
|
boolean |
equals(Object o)
|
int |
getByteLength()
Return length in bytes. |
byte[] |
getBytes()
Return UTF-8 encoded bytes. |
static byte[] |
getBytesFor(String str)
Gets the UTF-8 bytes for a String |
int |
getLength()
Deprecated. call getByteLength() instead. |
int |
hashCode()
|
int |
length()
|
Utf8 |
setByteLength(int newLength)
Set length in bytes. |
Utf8 |
setLength(int newLength)
Deprecated. call setByteLength(int) instead. |
CharSequence |
subSequence(int start,
int end)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Utf8()
public Utf8(String string)
public Utf8(byte[] bytes)
Method Detail |
---|
public byte[] getBytes()
getByteLength()
.
public int getLength()
getByteLength()
instead.
public int getByteLength()
public Utf8 setLength(int newLength)
setByteLength(int)
instead.
public Utf8 setByteLength(int newLength)
public String toString()
toString
in interface CharSequence
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(Utf8 that)
compareTo
in interface Comparable<Utf8>
public char charAt(int index)
charAt
in interface CharSequence
public int length()
length
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public static final byte[] getBytesFor(String str)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |