public class UnsynchronizedBuffer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
UnsynchronizedBuffer.Reader
A byte buffer reader.
|
static class |
UnsynchronizedBuffer.Writer
A byte buffer writer.
|
| Constructor and Description |
|---|
UnsynchronizedBuffer() |
| 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 boolean |
isNegativeVInt(byte value)
Given the first byte of a vint/vlong, determine the sign
|
static int |
nextArraySize(int i)
Determines what next array size should be by rounding up to next power of two.
|
static int |
writeVInt(byte[] dest,
int offset,
int i)
Writes a variable int directly to a byte array.
|
static void |
writeVInt(DataOutput out,
byte[] workBuffer,
int i)
Use the provided byte[] to buffer only the bytes used to write out the integer i to the
DataOutput out.
|
static int |
writeVLong(byte[] dest,
int offset,
long value)
Writes a variable long directly to a byte array.
|
static void |
writeVLong(DataOutput out,
byte[] workBuffer,
long i)
Use the provided byte[] to buffer only the bytes used to write out the long i to the DataOutput
out.
|
public static boolean isNegativeVInt(byte value)
value - the first bytepublic static int decodeVIntSize(byte value)
value - the first byte of the vint/vlongpublic static int nextArraySize(int i)
i - current array sizeIllegalArgumentException - if i is negativepublic static void writeVInt(DataOutput out, byte[] workBuffer, int i) throws IOException
IOExceptionpublic static void writeVLong(DataOutput out, byte[] workBuffer, long i) throws IOException
IOExceptionpublic static int writeVInt(byte[] dest,
int offset,
int i)
public static int writeVLong(byte[] dest,
int offset,
long value)
dest - The destination array for the long to be written tooffset - The location where to write the long tovalue - The long value being written into byte arrayCopyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.