public class VarIntUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
VarIntUtil.ArrayDecoder
decodes an array of varints
|
static class |
VarIntUtil.SignedArrayDecoder |
| Constructor and Description |
|---|
VarIntUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int[] |
decodeDeltaDeltaZigZag(int[] ddz) |
static int |
decodeZigZag(int x) |
static int[] |
encodeDeltaDeltaZigZag(int[] x) |
static int[] |
encodeDeltaDeltaZigZag(IntArray a) |
static int[] |
encodeDeltaDeltaZigZag(SortedIntArray a) |
static int |
encodeSigned(byte[] buf,
int pos,
int x) |
static int |
encodeZigZag(int x) |
static int |
getEncodedSize(int size)
get the number of bytes necessary to encode value
|
static VarIntUtil.ArrayDecoder |
newArrayDecoder(byte[] buf) |
static int |
readSignedVarInt32(ByteBuffer bb) |
static String |
readSizeDelimitedString(ByteBuffer bb) |
static int |
readVarInt32(ByteBuffer bb) |
static long |
readVarInt64(ByteBuffer bb) |
static void |
writeSignedVarint32(ByteBuffer bb,
int x) |
static void |
writeSizeDelimitedString(ByteBuffer bb,
String s) |
static int |
writeVarint32(byte[] buf,
int pos,
int x)
Encodes x as varint in the buffer at position pos and returns the new position
|
static void |
writeVarInt32(ByteBuffer bb,
int x) |
static void |
writeVarInt64(ByteBuffer bb,
long x) |
public static int writeVarint32(byte[] buf,
int pos,
int x)
buf - x - public static void writeVarInt32(ByteBuffer bb, int x)
public static void writeVarInt64(ByteBuffer bb, long x)
public static int readVarInt32(ByteBuffer bb) throws DecodingException
DecodingExceptionpublic static long readVarInt64(ByteBuffer bb)
public static void writeSignedVarint32(ByteBuffer bb, int x)
public static int readSignedVarInt32(ByteBuffer bb) throws DecodingException
DecodingExceptionpublic static int encodeSigned(byte[] buf,
int pos,
int x)
public static VarIntUtil.ArrayDecoder newArrayDecoder(byte[] buf)
public static int decodeZigZag(int x)
public static int encodeZigZag(int x)
public static void writeSizeDelimitedString(ByteBuffer bb, String s)
public static String readSizeDelimitedString(ByteBuffer bb) throws DecodingException
DecodingExceptionpublic static int[] encodeDeltaDeltaZigZag(int[] x)
public static int[] decodeDeltaDeltaZigZag(int[] ddz)
public static int[] encodeDeltaDeltaZigZag(SortedIntArray a)
public static int[] encodeDeltaDeltaZigZag(IntArray a)
public static int getEncodedSize(int size)
size - Copyright © 2017 Space Applications Services. All rights reserved.