org.apache.hadoop.hbase.io.util
Class StreamUtils

java.lang.Object
  extended by org.apache.hadoop.hbase.io.util.StreamUtils

@InterfaceAudience.Private
public class StreamUtils
extends Object


Constructor Summary
StreamUtils()
           
 
Method Summary
static Pair<Integer,Integer> readRawVarint32(byte[] input, int offset)
          Reads a varInt value stored in an array.
static int readRawVarint32(ByteBuffer input)
           
static int readRawVarint32(InputStream input)
           
static short toShort(byte hi, byte lo)
           
static void writeRawVInt32(OutputStream output, int value)
           
static void writeShort(OutputStream out, short v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamUtils

public StreamUtils()
Method Detail

writeRawVInt32

public static void writeRawVInt32(OutputStream output,
                                  int value)
                           throws IOException
Throws:
IOException

readRawVarint32

public static int readRawVarint32(InputStream input)
                           throws IOException
Throws:
IOException

readRawVarint32

public static int readRawVarint32(ByteBuffer input)
                           throws IOException
Throws:
IOException

readRawVarint32

public static Pair<Integer,Integer> readRawVarint32(byte[] input,
                                                    int offset)
                                             throws IOException
Reads a varInt value stored in an array.

Parameters:
input - Input array where the varInt is available
offset - Offset in the input array where varInt is available
Returns:
A pair of integers in which first value is the actual decoded varInt value and second value as number of bytes taken by this varInt for it's storage in the input array.
Throws:
IOException

toShort

public static short toShort(byte hi,
                            byte lo)

writeShort

public static void writeShort(OutputStream out,
                              short v)
                       throws IOException
Throws:
IOException


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.