Class StorageBuffer
Hierarchy
- StorageBuffer
Index
Constructors
Methods
Constructors
constructor
-
Creates a new storage buffer instance
Parameters
-
engine: ThinEngine
The engine the buffer will be created inside
-
size: number
The size of the buffer in bytes
-
Optional creationFlags: number
flags to use when creating the buffer (see Constants.BUFFER_CREATIONFLAG_XXX). The BUFFER_CREATIONFLAG_STORAGE flag will be automatically added.
Returns StorageBuffer
-
Methods
disposeSearch playground for dispose
-
Disposes the storage buffer
Returns void
get BufferSearch playground for getBuffer
-
Gets underlying native buffer
Returns DataBuffer
underlying native buffer
readSearch playground for read
-
Reads data from the storage buffer
Parameters
-
Optional offset: number
The offset in the storage buffer to start reading from (default: 0)
-
Optional size: number
The number of bytes to read from the storage buffer (default: capacity of the buffer)
-
Optional buffer: ArrayBufferView
The buffer to write the data we have read from the storage buffer to (optional)
Returns Promise<ArrayBufferView>
If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer
-
updateSearch playground for update
-
Updates the storage buffer
Parameters
-
data: DataArray
the data used to update the storage buffer
-
Optional byteOffset: number
the byte offset of the data (optional)
-
Optional byteLength: number
the byte length of the data (optional)
Returns void
-
This class is a small wrapper around a native buffer that can be read and/or written