org.apache.hadoop.streaming
Class UTF8ByteArrayUtils

java.lang.Object
  extended by org.apache.hadoop.streaming.UTF8ByteArrayUtils

Deprecated. use UTF8ByteArrayUtils and StreamKeyValUtil instead

public class UTF8ByteArrayUtils
extends Object

General utils for byte array containing UTF-8 encoded strings


Constructor Summary
UTF8ByteArrayUtils()
          Deprecated.  
 
Method Summary
static int findByte(byte[] utf, int start, int end, byte b)
          Deprecated. use UTF8ByteArrayUtils.findByte(byte[], int, int, byte)
static int findBytes(byte[] utf, int start, int end, byte[] b)
          Deprecated. use UTF8ByteArrayUtils.findBytes(byte[], int, int, byte[])
static int findNthByte(byte[] utf, byte b, int n)
          Deprecated. use UTF8ByteArrayUtils.findNthByte(byte[], byte, int)
static int findNthByte(byte[] utf, int start, int length, byte b, int n)
          Deprecated. use UTF8ByteArrayUtils.findNthByte(byte[], int, int, byte, int)
static int findTab(byte[] utf)
          Deprecated. use StreamKeyValUtil.findTab(byte[])
static int findTab(byte[] utf, int start, int length)
          Deprecated. use StreamKeyValUtil.findTab(byte[], int, int)
static int readLine(LineReader lineReader, Text out)
          Deprecated. use StreamKeyValUtil.readLine(LineReader, Text)
static void splitKeyVal(byte[] utf, int start, int length, Text key, Text val, int splitPos)
          Deprecated. use StreamKeyValUtil.splitKeyVal(byte[], int, int, Text, Text, int)
static void splitKeyVal(byte[] utf, int start, int length, Text key, Text val, int splitPos, int separatorLength)
          Deprecated. use StreamKeyValUtil.splitKeyVal(byte[], int, int, Text, Text, int, int)
static void splitKeyVal(byte[] utf, Text key, Text val, int splitPos)
          Deprecated. use StreamKeyValUtil.splitKeyVal(byte[], Text, Text, int)
static void splitKeyVal(byte[] utf, Text key, Text val, int splitPos, int separatorLength)
          Deprecated. use StreamKeyValUtil.splitKeyVal(byte[], Text, Text, int, int)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UTF8ByteArrayUtils

public UTF8ByteArrayUtils()
Deprecated. 
Method Detail

findTab

@Deprecated
public static int findTab(byte[] utf,
                                     int start,
                                     int length)
Deprecated. use StreamKeyValUtil.findTab(byte[], int, int)

Find the first occured tab in a UTF-8 encoded string

Parameters:
utf - a byte array containing a UTF-8 encoded string
start - starting offset
length - no. of bytes
Returns:
position that first tab occures otherwise -1

findByte

@Deprecated
public static int findByte(byte[] utf,
                                      int start,
                                      int end,
                                      byte b)
Deprecated. use UTF8ByteArrayUtils.findByte(byte[], int, int, byte)

Find the first occurrence of the given byte b in a UTF-8 encoded string

Parameters:
utf - a byte array containing a UTF-8 encoded string
start - starting offset
end - ending position
b - the byte to find
Returns:
position that first byte occures otherwise -1

findBytes

@Deprecated
public static int findBytes(byte[] utf,
                                       int start,
                                       int end,
                                       byte[] b)
Deprecated. use UTF8ByteArrayUtils.findBytes(byte[], int, int, byte[])

Find the first occurrence of the given bytes b in a UTF-8 encoded string

Parameters:
utf - a byte array containing a UTF-8 encoded string
start - starting offset
end - ending position
b - the bytes to find
Returns:
position that first byte occures otherwise -1

findNthByte

@Deprecated
public static int findNthByte(byte[] utf,
                                         int start,
                                         int length,
                                         byte b,
                                         int n)
Deprecated. use UTF8ByteArrayUtils.findNthByte(byte[], int, int, byte, int)

Find the nth occurrence of the given byte b in a UTF-8 encoded string

Parameters:
utf - a byte array containing a UTF-8 encoded string
start - starting offset
length - the length of byte array
b - the byte to find
n - the desired occurrence of the given byte
Returns:
position that nth occurrence of the given byte if exists; otherwise -1

findNthByte

@Deprecated
public static int findNthByte(byte[] utf,
                                         byte b,
                                         int n)
Deprecated. use UTF8ByteArrayUtils.findNthByte(byte[], byte, int)

Find the nth occurrence of the given byte b in a UTF-8 encoded string

Parameters:
utf - a byte array containing a UTF-8 encoded string
b - the byte to find
n - the desired occurrence of the given byte
Returns:
position that nth occurrence of the given byte if exists; otherwise -1

findTab

@Deprecated
public static int findTab(byte[] utf)
Deprecated. use StreamKeyValUtil.findTab(byte[])

Find the first occured tab in a UTF-8 encoded string

Parameters:
utf - a byte array containing a UTF-8 encoded string
Returns:
position that first tab occures otherwise -1

splitKeyVal

@Deprecated
public static void splitKeyVal(byte[] utf,
                                          int start,
                                          int length,
                                          Text key,
                                          Text val,
                                          int splitPos,
                                          int separatorLength)
                        throws IOException
Deprecated. use StreamKeyValUtil.splitKeyVal(byte[], int, int, Text, Text, int, int)

split a UTF-8 byte array into key and value assuming that the delimilator is at splitpos.

Parameters:
utf - utf-8 encoded string
start - starting offset
length - no. of bytes
key - contains key upon the method is returned
val - contains value upon the method is returned
splitPos - the split pos
separatorLength - the length of the separator between key and value
Throws:
IOException

splitKeyVal

@Deprecated
public static void splitKeyVal(byte[] utf,
                                          int start,
                                          int length,
                                          Text key,
                                          Text val,
                                          int splitPos)
                        throws IOException
Deprecated. use StreamKeyValUtil.splitKeyVal(byte[], int, int, Text, Text, int)

split a UTF-8 byte array into key and value assuming that the delimilator is at splitpos.

Parameters:
utf - utf-8 encoded string
start - starting offset
length - no. of bytes
key - contains key upon the method is returned
val - contains value upon the method is returned
splitPos - the split pos
Throws:
IOException

splitKeyVal

@Deprecated
public static void splitKeyVal(byte[] utf,
                                          Text key,
                                          Text val,
                                          int splitPos,
                                          int separatorLength)
                        throws IOException
Deprecated. use StreamKeyValUtil.splitKeyVal(byte[], Text, Text, int, int)

split a UTF-8 byte array into key and value assuming that the delimilator is at splitpos.

Parameters:
utf - utf-8 encoded string
key - contains key upon the method is returned
val - contains value upon the method is returned
splitPos - the split pos
separatorLength - the length of the separator between key and value
Throws:
IOException

splitKeyVal

@Deprecated
public static void splitKeyVal(byte[] utf,
                                          Text key,
                                          Text val,
                                          int splitPos)
                        throws IOException
Deprecated. use StreamKeyValUtil.splitKeyVal(byte[], Text, Text, int)

split a UTF-8 byte array into key and value assuming that the delimilator is at splitpos.

Parameters:
utf - utf-8 encoded string
key - contains key upon the method is returned
val - contains value upon the method is returned
splitPos - the split pos
Throws:
IOException

readLine

@Deprecated
public static int readLine(LineReader lineReader,
                                      Text out)
                    throws IOException
Deprecated. use StreamKeyValUtil.readLine(LineReader, Text)

Read a utf8 encoded line from a data input stream.

Parameters:
lineReader - LineReader to read the line from.
out - Text to read into
Returns:
number of bytes read
Throws:
IOException


Copyright © 2009 The Apache Software Foundation