Constructor
new DataWriter(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. |
- Source
Classes
Methods
writeBinaryArray(byteOffset, array) → {number}
Write a boolean array as binary.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeFloat32(byteOffset, value) → {number}
Write Float32 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | number | The data to write. |
- Source
The new offset position.
- Type:
- number
writeFloat32Array(byteOffset, array) → {number}
Write Float32 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeFloat64(byteOffset, value) → {number}
Write Float64 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | number | The data to write. |
- Source
The new offset position.
- Type:
- number
writeFloat64Array(byteOffset, array) → {number}
Write Float64 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeHex(byteOffset, str) → {number}
Write string data of length 4 as hexadecimal (no '0x' prefix).
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
str | string | The hexadecimal string to write ('####'). |
- Source
The new offset position.
- Type:
- number
writeInt16(byteOffset, value) → {number}
Write Int16 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | number | The data to write. |
- Source
The new offset position.
- Type:
- number
writeInt16Array(byteOffset, array) → {number}
Write Int16 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeInt32(byteOffset, value) → {number}
Write Int32 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | number | The data to write. |
- Source
The new offset position.
- Type:
- number
writeInt32Array(byteOffset, array) → {number}
Write Int32 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeInt64(byteOffset, value) → {number}
Write Int64 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | bigint | The data to write. |
- Source
The new offset position.
- Type:
- number
writeInt64Array(byteOffset, array) → {number}
Write Int64 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeInt8(byteOffset, value) → {number}
Write Int8 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | number | The data to write. |
- Source
The new offset position.
- Type:
- number
writeInt8Array(byteOffset, array) → {number}
Write Int8 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeUint16(byteOffset, value) → {number}
Write Uint16 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | number | The data to write. |
- Source
The new offset position.
- Type:
- number
writeUint16Array(byteOffset, array) → {number}
Write Uint16 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeUint32(byteOffset, value) → {number}
Write Uint32 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | number | The data to write. |
- Source
The new offset position.
- Type:
- number
writeUint32Array(byteOffset, array) → {number}
Write Uint32 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeUint64(byteOffset, value) → {number}
Write Uint64 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | bigint | The data to write. |
- Source
The new offset position.
- Type:
- number
writeUint64Array(byteOffset, array) → {number}
Write Uint64 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | The array to write. |
- Source
The new offset position.
- Type:
- number
writeUint8(byteOffset, value) → {number}
Write Uint8 data.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
value | number | The data to write. |
- Source
The new offset position.
- Type:
- number
writeUint8Array(byteOffset, array) → {number}
Write Uint8 array.
Name | Type | Description |
---|---|---|
byteOffset | number | The offset to start writing from. |
array | Array | | The array to write. |
- Source
The new offset position.
- Type:
- number