Interfaces
VariableSizeEncoder
An object that can encode a value of type TFrom into a variable-size ReadonlyUint8Array.
See Encoder to learn more about creating and composing encoders.
Example
See
Type Parameters
Type Parameter | Description |
---|---|
TFrom | The type of the value to encode. |
Properties
Property | Modifier | Type | Description |
---|---|---|---|
encode | readonly | (value ) => ReadonlyUint8Array | Encode the provided value and return the encoded bytes directly. |
getSizeFromValue | readonly | (value ) => number | Returns the size of the encoded value in bytes for a given input. |
maxSize? | readonly | number | The maximum possible size of an encoded value in bytes, if applicable. |
write | readonly | (value , bytes , offset ) => number | Writes the encoded value into the provided byte array at the given offset. Returns the offset of the next byte after the encoded value. |