public class Varint extends Object
Encodes signed and unsigned values using a common variable-length scheme, found for example in Google's Protocol Buffers. It uses fewer bytes to encode smaller values, but will use slightly more bytes to encode large values.
Signed values are further encoded using so-called zig-zag encoding in order to make them "compatible" with variable-length encoding.
|Modifier and Type||Method and Description|
Decodes a value using the variable-length encoding from Google's Protocol Buffers
Encodes a value using the variable-length encoding from Google's Protocol Buffers.
public static byte writeUnsignedVarInt(int value)
value- Value to encode
public static int readUnsignedVarInt(byte bytes)
bytes- Encoded byte array
Copyright © 2018. All rights reserved.