Constructor
new DataReader(buffer, isLittleEndianopt)
Name | Type | Attributes | Description |
---|---|---|---|
buffer | ArrayBuffer | The input array buffer. | |
isLittleEndian | boolean | <optional> | Flag to tell if the data is little or big endian (default: true). |
- Source
Classes
Methods
readBigInt64(byteOffset) → {bigint}
Read BigInt64 (8 bytes) data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
- Source
The read data.
- Type:
- bigint
readBigUint64(byteOffset) → {bigint}
Read BigUint64 (8 bytes) data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
- Source
The read data.
- Type:
- bigint
readBinaryArray(byteOffset, size) → {Uint8Array}
Read binary (0/1) array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- Uint8Array
readFloat32(byteOffset) → {number}
Read Float32 (4 bytes) data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
- Source
The read data.
- Type:
- number
readFloat32Array(byteOffset, size) → {Float32Array}
Read Float32 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- Float32Array
readFloat64(byteOffset) → {number}
Read Float64 (8 bytes) data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
- Source
The read data.
- Type:
- number
readFloat64Array(byteOffset, size) → {Float64Array}
Read Float64 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- Float64Array
readHex(byteOffset) → {string}
Read data as an hexadecimal string of length 4 (no '0x' prefix).
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
- Source
The read data ('####').
- Type:
- string
readInt16(byteOffset) → {number}
Read Int16 (2 bytes) data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
- Source
The read data.
- Type:
- number
readInt16Array(byteOffset, size) → {Int16Array}
Read Int16 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- Int16Array
readInt32(byteOffset) → {number}
Read Int32 (4 bytes) data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
- Source
The read data.
- Type:
- number
readInt32Array(byteOffset, size) → {Int32Array}
Read Int32 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- Int32Array
readInt64Array(byteOffset, size) → {BigInt64Array}
Read Int64 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- BigInt64Array
readInt8Array(byteOffset, size) → {Int8Array}
Read Int8 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- Int8Array
readUint16(byteOffset) → {number}
Read Uint16 (2 bytes) data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
- Source
The read data.
- Type:
- number
readUint16Array(byteOffset, size) → {Uint16Array}
Read Uint16 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- Uint16Array
readUint32(byteOffset) → {number}
Read Uint32 (4 bytes) data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
- Source
The read data.
- Type:
- number
readUint32Array(byteOffset, size) → {Uint32Array}
Read Uint32 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- Uint32Array
readUint64Array(byteOffset, size) → {BigUint64Array}
Read Uint64 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- BigUint64Array
readUint8Array(byteOffset, size) → {Uint8Array}
Read Uint8 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start reading from. |
size | number | The size of the array. |
- Source
The read data.
- Type:
- Uint8Array