org.apache.hadoop.hive.serde2.binarysortable
Class InputByteBuffer

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.binarysortable.InputByteBuffer

public class InputByteBuffer
extends Object

This class is much more efficient than ByteArrayInputStream because none of the methods are synchronized.


Constructor Summary
InputByteBuffer()
           
 
Method Summary
 String dumpHex()
          Return the bytes in hex format.
 byte[] getData()
          Returns the underlying byte array.
 byte read(boolean invert)
          Read one byte from the byte buffer.
 void reset(byte[] data, int start, int end)
          Reset the byte buffer to the given byte range.
 void seek(int position)
          Set the current position.
 int tell()
          Return the current position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputByteBuffer

public InputByteBuffer()
Method Detail

reset

public void reset(byte[] data,
                  int start,
                  int end)
Reset the byte buffer to the given byte range.


read

public final byte read(boolean invert)
                throws IOException
Read one byte from the byte buffer. Final method to help inlining.

Parameters:
invert - whether we want to invert all the bits.
Throws:
IOException

tell

public final int tell()
Return the current position. Final method to help inlining.


seek

public final void seek(int position)
Set the current position. Final method to help inlining.


getData

public final byte[] getData()
Returns the underlying byte array.


dumpHex

public String dumpHex()
Return the bytes in hex format.



Copyright © 2009 The Apache Software Foundation