public final class Varint
extends java.lang.Object
| Constructor and Description |
|---|
Varint() |
| Modifier and Type | Method and Description |
|---|---|
static long |
decodeSignedLong(byte[] buf)
Decode a varint encoded signed long value
|
static long |
decodeSignedLong(java.nio.ByteBuffer buffer)
Decode a varint encoded signed long value
|
static long |
decodeSignedLong(CustomBuffer buffer)
Decode a varint encoded signed long value
|
static long |
decodeUnsignedLong(byte[] buf)
Decode a varint encoded unsigned long value.
|
static long |
decodeUnsignedLong(java.nio.ByteBuffer buffer)
Decode a varint encoded unsigned long value stored in a ByteBuffer.
|
static long |
decodeUnsignedLong(CustomBuffer buffer)
Decode a varint encoded unsigned long value stored in a ByteBuffer.
|
static byte[] |
encodeSignedLong(long value)
Encode a signed long using zig zag varint encoding.
|
static int |
encodeSignedLongInBuf(long value,
byte[] buf)
Encode a signed long using zig zag varint encoding.
|
static byte[] |
encodeUnsignedLong_ORIGINAL(long value) |
static byte[] |
encodeUnsignedLong(long value) |
static byte[] |
encodeUnsignedLongBRANCHMISPREDICT(long value)
Encode an unsigned long using varint encoding.
|
static int |
encodeUnsignedLongInBuf(long value,
byte[] buf) |
static int |
skipVarint(java.nio.ByteBuffer buffer)
Skip a Varint in a ByteBuffer
|
public static byte[] encodeUnsignedLongBRANCHMISPREDICT(long value)
value - Value to encodepublic static byte[] encodeUnsignedLong_ORIGINAL(long value)
public static byte[] encodeUnsignedLong(long value)
public static int encodeUnsignedLongInBuf(long value,
byte[] buf)
value - Value to encodebuf - buffer to encode in, MUST be large enoughpublic static int encodeSignedLongInBuf(long value,
byte[] buf)
value - Value to encodepublic static byte[] encodeSignedLong(long value)
value - Value to encodepublic static long decodeUnsignedLong(byte[] buf)
buf - Buffer containing the encoded valuepublic static long decodeSignedLong(byte[] buf)
buf - Buffer containing the encoded valuepublic static long decodeUnsignedLong(java.nio.ByteBuffer buffer)
buffer - The ByteBuffer from which to read the data.
The buffer is assumed to be positioned where the data should be read.public static long decodeSignedLong(java.nio.ByteBuffer buffer)
buffer - The ByteBuffer from which to read the data.
The buffer is assumed to be positioned where the data should be read.public static int skipVarint(java.nio.ByteBuffer buffer)
public static long decodeUnsignedLong(CustomBuffer buffer)
buffer - The ByteBuffer from which to read the data.
The buffer is assumed to be positioned where the data should be read.public static long decodeSignedLong(CustomBuffer buffer)
buffer - The ByteBuffer from which to read the data.
The buffer is assumed to be positioned where the data should be read.