public static class ByteBufUtil.HadoopWritables extends Object
org.apache.hadoop.io.WritableUtils
.
We copy the code to avoid wrapping DrillBuf
to/from DataInput
.Constructor and Description |
---|
HadoopWritables() |
Modifier and Type | Method and Description |
---|---|
static int |
decodeVIntSize(byte value)
Parse the first byte of a vint/vlong to determine the number of bytes
|
static int |
getVIntSize(long i)
Get the encoded length if an integer is stored in a variable-length format
|
static boolean |
isNegativeVInt(byte value)
Given the first byte of a vint/vlong, determine the sign
|
static int |
readVInt(DrillBuf buffer,
int start,
int end)
Reads a zero-compressed encoded integer from input stream and returns it.
|
static long |
readVLong(DrillBuf buffer,
int start,
int end)
Reads a zero-compressed encoded long from input stream and returns it.
|
static void |
writeVInt(DrillBuf buffer,
int start,
int end,
int i)
Serializes an integer to a binary stream with zero-compressed encoding.
|
static void |
writeVLong(DrillBuf buffer,
int start,
int end,
long i)
Serializes a long to a binary stream with zero-compressed encoding.
|
public static void writeVInt(DrillBuf buffer, int start, int end, int i)
buffer
- DrillBuf to read fromi
- Integer to be serializedpublic static void writeVLong(DrillBuf buffer, int start, int end, long i)
buffer
- DrillBuf to write toi
- Long to be serializedpublic static int readVInt(DrillBuf buffer, int start, int end)
buffer
- DrillBuf to read frompublic static long readVLong(DrillBuf buffer, int start, int end)
buffer
- DrillBuf to read frompublic static int decodeVIntSize(byte value)
value
- the first byte of the vint/vlongpublic static int getVIntSize(long i)
public static boolean isNegativeVInt(byte value)
value
- the first byteCopyright © 1970 The Apache Software Foundation. All rights reserved.