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 |
Members
_dv
Getter of the DataView containing this object's data
.Getter of the DataView containing this object's data
(static) binaryProps
Static getter for the class binary props
.Static getter for the class binary props
(static) binarySize
Static getter for the class binary size
.Static getter for the class binary size
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 |
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
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 |
Returns:
- The array
list
where the objects have been added
- Type
- array