DataWriter

Data writer.

Constructor

new DataWriter(buffer, isLittleEndianopt)

Parameters:
NameTypeAttributesDescription
bufferArrayBuffer

The input array buffer.

isLittleEndianboolean<optional>

Flag to tell if the data is little or big endian.

Classes

DataWriter

Methods

writeBinaryArray(byteOffset, array) → {number}

Write a boolean array as binary.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeFloat32(byteOffset, value) → {number}

Write Float32 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuenumber

The data to write.

Returns:

The new offset position.

Type: 
number

writeFloat32Array(byteOffset, array) → {number}

Write Float32 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeFloat64(byteOffset, value) → {number}

Write Float64 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuenumber

The data to write.

Returns:

The new offset position.

Type: 
number

writeFloat64Array(byteOffset, array) → {number}

Write Float64 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeHex(byteOffset, str) → {number}

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

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

strstring

The hexadecimal string to write ('####').

Returns:

The new offset position.

Type: 
number

writeInt16(byteOffset, value) → {number}

Write Int16 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuenumber

The data to write.

Returns:

The new offset position.

Type: 
number

writeInt16Array(byteOffset, array) → {number}

Write Int16 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeInt32(byteOffset, value) → {number}

Write Int32 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuenumber

The data to write.

Returns:

The new offset position.

Type: 
number

writeInt32Array(byteOffset, array) → {number}

Write Int32 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeInt64(byteOffset, value) → {number}

Write Int64 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuebigint

The data to write.

Returns:

The new offset position.

Type: 
number

writeInt64Array(byteOffset, array) → {number}

Write Int64 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeInt8(byteOffset, value) → {number}

Write Int8 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuenumber

The data to write.

Returns:

The new offset position.

Type: 
number

writeInt8Array(byteOffset, array) → {number}

Write Int8 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeUint16(byteOffset, value) → {number}

Write Uint16 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuenumber

The data to write.

Returns:

The new offset position.

Type: 
number

writeUint16Array(byteOffset, array) → {number}

Write Uint16 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeUint32(byteOffset, value) → {number}

Write Uint32 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuenumber

The data to write.

Returns:

The new offset position.

Type: 
number

writeUint32Array(byteOffset, array) → {number}

Write Uint32 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeUint64(byteOffset, value) → {number}

Write Uint64 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuebigint

The data to write.

Returns:

The new offset position.

Type: 
number

writeUint64Array(byteOffset, array) → {number}

Write Uint64 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray

The array to write.

Returns:

The new offset position.

Type: 
number

writeUint8(byteOffset, value) → {number}

Write Uint8 data.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

valuenumber

The data to write.

Returns:

The new offset position.

Type: 
number

writeUint8Array(byteOffset, array) → {number}

Write Uint8 array.

Parameters:
NameTypeDescription
byteOffsetnumber

The offset to start writing from.

arrayArray | Uint8Array

The array to write.

Returns:

The new offset position.

Type: 
number