Logo Search packages:      
Sourcecode: hadoop version File versions  Download package

org::apache::hadoop::io::Text Class Reference

Inheritance diagram for org::apache::hadoop::io::Text:


List of all members.

Detailed Description

This class stores text using standard UTF8 encoding. It provides methods to serialize, deserialize, and compare texts at byte level. The type of length is integer and is serialized using zero-compressed format.

In addition, it provides methods for string traversal without converting the byte array to a string.

Also includes utilities for serializing/deserialing a string, coding/decoding a string, checking if a byte array contains valid UTF8 code, calculating the length of an encoded string.

Definition at line 47 of file Text.java.

Public Member Functions

void append (byte[] utf8, int start, int len)
int charAt (int position)
void clear ()
int compareTo (byte[] other, int off, int len)
int compareTo (BinaryComparable other)
boolean equals (Object o)
int find (String what, int start)
int find (String what)
byte[] getBytes ()
int getLength ()
int hashCode ()
void readFields (DataInput in) throws IOException
void set (byte[] utf8, int start, int len)
void set (Text other)
void set (byte[] utf8)
void set (String string)
 Text (byte[] utf8)
 Text (Text utf8)
 Text (String string)
String toString ()
void write (DataOutput out) throws IOException

Static Public Member Functions

static int bytesToCodePoint (ByteBuffer bytes)
static String decode (byte[] utf8, int start, int length, boolean replace) throws CharacterCodingException
static String decode (byte[] utf8, int start, int length) throws CharacterCodingException
static String decode (byte[] utf8) throws CharacterCodingException
static ByteBuffer encode (String string, boolean replace) throws CharacterCodingException
static ByteBuffer encode (String string) throws CharacterCodingException
static String readString (DataInput in) throws IOException
static void skip (DataInput in) throws IOException
static int utf8Length (String string)
static void validateUTF8 (byte[] utf8, int start, int len) throws MalformedInputException
static void validateUTF8 (byte[] utf8) throws MalformedInputException
static int writeString (DataOutput out, String s) throws IOException

Static Package Functions

 [static initializer]

Static Package Attributes

static final int[] bytesFromUTF8
static final int offsetsFromUTF8 []

Private Member Functions

void setCapacity (int len, boolean keepData)

Static Private Member Functions

static String decode (ByteBuffer utf8, boolean replace) throws CharacterCodingException

Private Attributes

byte[] bytes
int length

Static Private Attributes

static ThreadLocal
< CharsetDecoder > 
static final byte[] EMPTY_BYTES = new byte[0]
static ThreadLocal
< CharsetEncoder > 
static final int LEAD_BYTE = 0
static final Log LOG = LogFactory.getLog(Text.class)
static final int TRAIL_BYTE = 2
static final int TRAIL_BYTE_1 = 1


class  Comparator

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index