DataReader

Data reader.

Constructor

new DataReader(buffer, isLittleEndianopt)

Parameters:
NameTypeAttributesDescription
bufferArrayBuffer

The input array buffer.

isLittleEndianboolean<optional>

Flag to tell if the data is little or big endian (default: true).

Classes

DataReader

Methods

readBigInt64(byteOffset) → {bigint}

Read BigInt64 (8 bytes) data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

Returns:

The read data.

Type: 
bigint

readBigUint64(byteOffset) → {bigint}

Read BigUint64 (8 bytes) data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

Returns:

The read data.

Type: 
bigint

readBinaryArray(byteOffset, size) → {Uint8Array}

Read binary (0/1) array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
Uint8Array

readFloat32(byteOffset) → {number}

Read Float32 (4 bytes) data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

Returns:

The read data.

Type: 
number

readFloat32Array(byteOffset, size) → {Float32Array}

Read Float32 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
Float32Array

readFloat64(byteOffset) → {number}

Read Float64 (8 bytes) data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

Returns:

The read data.

Type: 
number

readFloat64Array(byteOffset, size) → {Float64Array}

Read Float64 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
Float64Array

readHex(byteOffset) → {string}

Read data as an hexadecimal string of length 4 (no '0x' prefix).

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

Returns:

The read data ('####').

Type: 
string

readInt16(byteOffset) → {number}

Read Int16 (2 bytes) data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

Returns:

The read data.

Type: 
number

readInt16Array(byteOffset, size) → {Int16Array}

Read Int16 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
Int16Array

readInt32(byteOffset) → {number}

Read Int32 (4 bytes) data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

Returns:

The read data.

Type: 
number

readInt32Array(byteOffset, size) → {Int32Array}

Read Int32 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
Int32Array

readInt64Array(byteOffset, size) → {BigInt64Array}

Read Int64 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
BigInt64Array

readInt8Array(byteOffset, size) → {Int8Array}

Read Int8 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
Int8Array

readUint16(byteOffset) → {number}

Read Uint16 (2 bytes) data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

Returns:

The read data.

Type: 
number

readUint16Array(byteOffset, size) → {Uint16Array}

Read Uint16 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
Uint16Array

readUint32(byteOffset) → {number}

Read Uint32 (4 bytes) data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

Returns:

The read data.

Type: 
number

readUint32Array(byteOffset, size) → {Uint32Array}

Read Uint32 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
Uint32Array

readUint64Array(byteOffset, size) → {BigUint64Array}

Read Uint64 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
BigUint64Array

readUint8Array(byteOffset, size) → {Uint8Array}

Read Uint8 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start reading from.

sizenumber

The size of the array.

Returns:

The read data.

Type: 
Uint8Array