| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.streaming.UTF8ByteArrayUtils
public class UTF8ByteArrayUtils
General utils for byte array containing UTF-8 encoded strings
| Constructor Summary | |
|---|---|
UTF8ByteArrayUtils()
 | 
|
| Method Summary | |
|---|---|
static int | 
findByte(byte[] utf,
         int start,
         int end,
         byte b)
Find the first occurrence of the given byte b in a UTF-8 encoded string  | 
static int | 
findNthByte(byte[] utf,
            byte b,
            int n)
Find the nth occurrence of the given byte b in a UTF-8 encoded string  | 
static int | 
findNthByte(byte[] utf,
            int start,
            int length,
            byte b,
            int n)
Find the nth occurrence of the given byte b in a UTF-8 encoded string  | 
static int | 
findTab(byte[] utf)
Find the first occured tab in a UTF-8 encoded string  | 
static int | 
findTab(byte[] utf,
        int start,
        int length)
Find the first occured tab in a UTF-8 encoded string  | 
static int | 
readLine(LineRecordReader.LineReader lineReader,
         Text out)
Read a utf8 encoded line from a data input stream.  | 
static void | 
splitKeyVal(byte[] utf,
            int start,
            int length,
            Text key,
            Text val,
            int splitPos)
split a UTF-8 byte array into key and value assuming that the delimilator is at splitpos.  | 
static void | 
splitKeyVal(byte[] utf,
            Text key,
            Text val,
            int splitPos)
split a UTF-8 byte array into key and value assuming that the delimilator is at splitpos.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public UTF8ByteArrayUtils()
| Method Detail | 
|---|
public static int findTab(byte[] utf,
                          int start,
                          int length)
utf - a byte array containing a UTF-8 encoded stringstart - starting offsetlength - no. of bytes
public static int findByte(byte[] utf,
                           int start,
                           int end,
                           byte b)
utf - a byte array containing a UTF-8 encoded stringstart - starting offsetend - ending positionb - the byte to find
public static int findNthByte(byte[] utf,
                              int start,
                              int length,
                              byte b,
                              int n)
utf - a byte array containing a UTF-8 encoded stringstart - starting offsetlength - the length of byte arrayb - the byte to findn - the desired occurrence of the given byte
public static int findNthByte(byte[] utf,
                              byte b,
                              int n)
utf - a byte array containing a UTF-8 encoded stringb - the byte to findn - the desired occurrence of the given byte
public static int findTab(byte[] utf)
utf - a byte array containing a UTF-8 encoded string
public static void splitKeyVal(byte[] utf,
                               int start,
                               int length,
                               Text key,
                               Text val,
                               int splitPos)
                        throws IOException
utf - utf-8 encoded stringstart - starting offsetlength - no. of byteskey - contains key upon the method is returnedval - contains value upon the method is returnedsplitPos - the split pos
IOException
public static void splitKeyVal(byte[] utf,
                               Text key,
                               Text val,
                               int splitPos)
                        throws IOException
utf - utf-8 encoded stringkey - contains key upon the method is returnedval - contains value upon the method is returnedsplitPos - the split pos
IOException
public static int readLine(LineRecordReader.LineReader lineReader,
                           Text out)
                    throws IOException
lineReader - LineReader to read the line from.out - Text to read into
IOException
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||