public class VarInt
extends java.lang.Object
Constructor and Description |
---|
VarInt() |
Modifier and Type | Method and Description |
---|---|
static int |
countVarIntsInRange(ByteData byteData,
long fieldPosition,
int length)
Count the number of variable length integers encoded in the supplied
ByteData in the specified range. |
static int |
nextVLongSize(ByteData arr,
long position)
Determine the size (in bytes) of the variable length long in the supplied
ByteData , starting at the specified position. |
static int |
readVInt(ByteData arr,
long position)
Read a variable length integer from the supplied
ByteData starting at the specified position. |
static int |
readVInt(java.io.InputStream in)
Read a variable length integer from the supplied InputStream
|
static long |
readVLong(ByteData arr,
long position)
Read a variable length long from the supplied
ByteData starting at the specified position. |
static long |
readVLong(java.io.InputStream in)
Read a variable length long from the supplied InputStream.
|
static boolean |
readVNull(ByteData arr,
long position)
Determine whether or not the value at the specified position in the supplied
ByteData is
a 'null' variable length integer. |
static int |
sizeOfVInt(int value)
Determine the size (in bytes) of the specified value when encoded as a variable length integer.
|
static int |
sizeOfVLong(long value)
Determine the size (in bytes) of the specified value when encoded as a variable length integer.
|
static int |
writeVInt(byte[] data,
int pos,
int value)
Write the value as a VarInt into the array, starting at the specified position.
|
static void |
writeVInt(ByteDataBuffer buf,
int value)
Encode the specified int as a variable length integer into the supplied
ByteDataBuffer |
static void |
writeVInt(java.io.OutputStream out,
int value)
Encode the specified int as a variable length integer into the supplied OutputStream
|
static void |
writeVLong(ByteDataBuffer buf,
long value)
Encode the specifed long as a variable length integer into the supplied
ByteDataBuffer |
static void |
writeVLong(java.io.OutputStream out,
long value)
Encode the specified long as a variable length integer into the supplied OuputStream
|
static void |
writeVNull(ByteDataBuffer buf)
Write a 'null' variable length integer into the supplied
ByteDataBuffer |
public static void writeVNull(ByteDataBuffer buf)
ByteDataBuffer
public static void writeVLong(ByteDataBuffer buf, long value)
ByteDataBuffer
public static void writeVLong(java.io.OutputStream out, long value) throws java.io.IOException
java.io.IOException
public static void writeVInt(ByteDataBuffer buf, int value)
ByteDataBuffer
public static void writeVInt(java.io.OutputStream out, int value) throws java.io.IOException
java.io.IOException
public static int writeVInt(byte[] data, int pos, int value)
public static boolean readVNull(ByteData arr, long position)
ByteData
is
a 'null' variable length integer.public static int readVInt(ByteData arr, long position)
ByteData
starting at the specified position.public static int readVInt(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static long readVLong(ByteData arr, long position)
ByteData
starting at the specified position.public static int nextVLongSize(ByteData arr, long position)
ByteData
, starting at the specified position.public static long readVLong(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static int sizeOfVInt(int value)
public static int sizeOfVLong(long value)