Example usage for Java org.apache.hadoop.io Text fields, constructors, methods, implement or subclass
The text is from its open source code.
Text() | |
Text(String string) Construct from a string. | |
Text(Text utf8) Construct from another text. | |
Text(byte[] utf8) Construct from a byte array. |
void | append(byte[] utf8, int start, int len) Append a range of bytes to the end of the given text |
int | bytesToCodePoint(ByteBuffer bytes) Returns the next code point at the current position in the buffer. |
int | charAt(int position) Returns the Unicode Scalar Value (32-bit integer value) for the character at position . |
void | clear() Clear the string to empty. |
int | compareTo(BinaryComparable other) Compare bytes from {#getBytes()}. |
int | compareTo(byte[] other, int off, int len) Compare bytes from {#getBytes()} to those provided. |
byte[] | copyBytes() Get a copy of the bytes that is exactly the length of the data. |
String | decode(byte[] utf8, int start, int length) |
String | decode(byte[] utf8) Converts the provided byte array to a String using the UTF-8 encoding. |
ByteBuffer | encode(String string) Converts the provided String to bytes using the UTF-8 encoding. |
ByteBuffer | encode(String string, boolean replace) Converts the provided String to bytes using the UTF-8 encoding. |
boolean | equals(Object o) Returns true iff o is a Text with the same contents. |
int | find(String what, int start) Finds any occurrence of what in the backing buffer, starting as position start . |
int | find(String what) |
byte[] | getBytes() Returns the raw bytes; however, only data up to #getLength() is valid. |
int | getLength() Returns the number of bytes in the byte array |
int | hashCode() |
void | readFields(DataInput in) deserialize |
String | readString(DataInput in) Read a UTF8 encoded string from in |
String | readString(DataInput in, int maxLength) Read a UTF8 encoded string with a maximum size |
void | set(String string) Set to contain the contents of a string. |
void | set(byte[] utf8) Set to a utf8 byte array |
void | set(Text other) copy a text. |
void | set(byte[] utf8, int start, int len) Set the Text to range of bytes |
void | skip(DataInput in) Skips over one Text in the input. |
String | toString() Convert text back to string |
void | write(DataOutput out) serialize write this object to out length uses zero-compressed encoding |
int | writeString(DataOutput out, String s) Write a UTF8 encoded string to out |