Class: Binary

Binary(binOrDv, initialOffset, isLazy)

Class allowing @binary members

Constructor

new Binary(binOrDv, initialOffset, isLazy)

Save own initial offset at binary data

.

Save own initial offset at binary data

Parameters:
Name Type Description
binOrDv ArrayBuffer/SharedArrayBuffer/DataView

The buffer where the data lives

initialOffset number

Buffer offset before this object data start

isLazy boolean

If true and binOrDv is not a {DataView}, wait until first acces before Instantiating the __dv

Source:

Members

_dv

Getter of the DataView containing this object's data

.

Getter of the DataView containing this object's data

Source:

(static) binaryProps

Static getter for the class binary props

.

Static getter for the class binary props

Source:

(static) binarySize

Static getter for the class binary size

.

Static getter for the class binary size

Source:

Methods

getByteAt(offset) → {number}

Get a single byte (as unsigned integer) from a position

.

Get a single byte (as unsigned integer) from a position

Parameters:
Name Type Description
offset number

The position of the byte to get

Source:
Returns:
  • The unsigned numerical number at the specified position
Type
number

toJSON() → {string}

Transform this object into a JSON string containing all the binary members

.

Transform this object into a JSON string containing all the binary members

Source:
Returns:
  • The JSON string
Type
string

(static) arrayFactory(binOrDv, length, initialOffset, list) → {array}

Fills an array with objects of this class using a unique buffer

.

Fills an array with objects of this class using a unique buffer

Parameters:
Name Type Description
binOrDv ArrayBuffer/SharedArrayBuffer/DataView

The buffer where the data lives

length number

The number of objects to add to the array

initialOffset number

Buffer offset before this object data start

list array

The array where new objects will be added

Source:
Returns:
  • The array list where the objects have been added
Type
array