Leb128 class
This class contains static methods you can use to encode and decode integers that follow LEB128 compression format.
Constructors
- Leb128()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
decodeSigned(
Uint8List bytes, {int n = 64}) → int - Converts a list of bytes that represent an LEB128 signed integer into an ordinary integer. The optional argument specifies the number of bits in the integer. For example, while dealing with a varint32, the second argument would be 32.
-
decodeUnsigned(
Uint8List bytes, {int n = 64}) → int - Converts a list of bytes that represent an LEB128 unsigned integer into an ordinary integer. The optional argument specifies the number of bits in the integer. For example, while dealing with a varuint7, the second argument would be 7.
-
decodeVarint7(
int byte) → dynamic - Utility method that decodes a varint7 value. Using this is easier because you don't have to convert your byte into a Uint8List object first.
-
decodeVaruint7(
int byte) → dynamic - Utility method that decodes a varuint7 value. Using this is easier because you don't have to convert your byte into a Uint8List object first.
-
encodeSigned(
int value) → Uint8List - Converts an ordinary integer into a list of bytes that contains an LEB128 signed integer. The size of the integer is decided automatically.
-
encodeUnsigned(
int value) → Uint8List - Converts an ordinary integer into a list of bytes that contains an LEB128 unsigned integer. The size of the integer is decided automatically.