org.apache.hadoop.hbase.io.util
Class StreamUtils
java.lang.Object
org.apache.hadoop.hbase.io.util.StreamUtils
@InterfaceAudience.Private
public class StreamUtils
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamUtils
public StreamUtils()
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 availableoffset
- 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.