public class UnsignedLEB128 extends Object
Modifier and Type | Method and Description |
---|---|
static long |
decode(byte[] bytes)
Given a byte array starting with an unsigned LEB128 value, returns the decoded form
of that value.
|
static byte[] |
encode(long value)
Returns a byte array containing the unsigned LEB128 representation of the given value.
|
static long |
read(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf)
Reads an unsigned LEB128 value from the buffer.
|
static int |
skip(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf)
Advances the buffer's reader index past the unsigned LEB128 value at the reader index.
|
static void |
write(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf,
long value)
Writes the unsigned LEB128 representation of the value to the buffer.
|
public static long read(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf)
ArithmeticException
- if the decoded value is longer than 64 bits.IndexOutOfBoundsException
- if the buffer's readable bytes do not contain a complete value.public static int skip(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf)
IndexOutOfBoundsException
- if the buffer's readable bytes do not contain a complete value.public static void write(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf, long value)
public static byte[] encode(long value)
public static long decode(byte[] bytes)
ArithmeticException
- if the decoded value is larger than 64 bits.IndexOutOfBoundsException
- if the input does not contain a complete LEB128 valueCopyright © 2021 Couchbase, Inc.. All rights reserved.