@InterfaceAudience.Private public class StreamUtils extends Object
Constructor and Description |
---|
StreamUtils() |
Modifier and Type | Method and Description |
---|---|
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) |
public static void writeRawVInt32(OutputStream output, int value) throws IOException
IOException
public static int readRawVarint32(InputStream input) throws IOException
IOException
public static int readRawVarint32(ByteBuffer input) throws IOException
IOException
public static Pair<Integer,Integer> readRawVarint32(byte[] input, int offset) throws IOException
input
- Input array where the varInt is availableoffset
- Offset in the input array where varInt is availableIOException
public static short toShort(byte hi, byte lo)
public static void writeShort(OutputStream out, short v) throws IOException
IOException
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.