VariableSizeEncoder<T> class final

A variable-size encoder whose byte length depends on the value being encoded.

Inheritance

Constructors

VariableSizeEncoder({required int getSizeFromValue(T value), required int write(T value, Uint8List bytes, int offset), int? maxSize})
Creates a variable-size encoder.

Properties

hashCode int
The hash code for this object.
no setterinherited
maxSize int?
The maximum possible size of an encoded value in bytes, if known.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

encode(T value) Uint8List
Encode value into a new Uint8List.
override
getSizeFromValue(T value) int
Returns the encoded byte size for the given value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
write(T value, Uint8List bytes, int offset) int
Write the encoded value into bytes starting at offset.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited