UTF8ByteArrayUtils (Hadoop 1.2.1 API)
Date: 2013-07-22

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.util
Class UTF8ByteArrayUtils

    java.lang.Object
      org.apache.hadoop.util.UTF8ByteArrayUtils

    public class UTF8ByteArrayUtils

extends Object

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` | `findBytes(byte[] utf, int start, int end, byte[] b)` Find the first occurrence of the given bytes 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

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### UTF8ByteArrayUtils

    public UTF8ByteArrayUtils()

Method Detail

### findByte

    public 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

  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

    public static int findBytes(byte[] utf,
                                int start,
                                int end,
                                byte[] b)

  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

    public 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

  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

    public static int findNthByte(byte[] utf,
                                  byte b,
                                  int n)

  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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation