Functions
getBytesEncoder
getBytesEncoder():
VariableSizeEncoder
<Uint8Array
<ArrayBufferLike
> |ReadonlyUint8Array
>
Returns an encoder for raw byte arrays.
This encoder writes byte arrays exactly as provided without modification.
The size of the encoded byte array is determined by the length of the input.
- To enforce a fixed size, consider using fixEncoderSize.
- To add a size prefix, use addEncoderSizePrefix.
- To add a sentinel value, use addEncoderSentinel.
For more details, see getBytesCodec.
Returns
VariableSizeEncoder
<Uint8Array
<ArrayBufferLike
> | ReadonlyUint8Array
>
A VariableSizeEncoder<ReadonlyUint8Array | Uint8Array>
.
Example
Encoding a byte array as-is.