public class VByte extends Object
1
if this byte is the last one.
E.g: 10000001
is value 1, 00000001 10000001
is 128 (decimal). Note that the value is stored
little-endian, so in this example 10000001 00000001
.Constructor and Description |
---|
VByte() |
Modifier and Type | Method and Description |
---|---|
static long |
decode(byte[] bytes,
int len)
Decode a series of encoded bytes, with a maximum of 8 bytes
|
static long |
decode(InputStream is)
Decode a maximum of 8 bytes from the input stream.
|
static long |
decodeFrom(byte[] b,
int start)
Decode a maximum of 8 bytes from a byte array.
|
static int |
encodedLength(long value)
Calculate the number of bytes needed for encoding a value
|
static boolean |
hasNext(byte b)
Checks if the most significant bit is set.
|
public static boolean hasNext(byte b)
b
- public static long decode(byte[] bytes, int len)
bytes
- byte arraylen
- number of bytes to decodepublic static long decode(InputStream is) throws IOException
is
- input streamIOException
public static long decodeFrom(byte[] b, int start) throws IOException
b
- byte arraystart
- starting positionIOException
public static int encodedLength(long value)
value
- numeric valueCopyright © 2015-2020 Eclipse Foundation. All Rights Reserved.