Class: BinaryDecoder
A class that provides methods for decoding binary data.
Constructors
new BinaryDecoder()
new BinaryDecoder(
writer
:BufferReader
):BinaryDecoder
Creates a new binary decoder.
Parameters
Parameter | Type | Description |
---|---|---|
| The buffer reader |
Returns
Defined in
Methods
fromArrayBuffer()
static
fromArrayBuffer(buffer
:ArrayBuffer
):BinaryDecoder
Creates a new binary decoder from an ArrayBuffer.
Parameters
Parameter | Type | Description |
---|---|---|
| The ArrayBuffer to decode |
Returns
The new binary decoder instance
Defined in
decode()
decode<
T
>(schema
:T
):InferBaseType
<T
>
Decodes a value from the buffer.
Type Parameters
Type Parameter |
---|
|
Parameters
Parameter | Type | Description |
---|---|---|
|
| The schema of the value to decode |
Returns
The decoded value
Throws
RangeError if the byte size of the readable schema is larger than the buffer size
Defined in
Properties
Property | Modifier | Type | Description | Defined in |
---|---|---|---|---|
reader | readonly | BufferReader | The buffer reader. | binary-decoder.ts:12 |