Options
All
  • Public
  • Public/Protected
  • All
Menu

This class is a small wrapper around a native buffer that can be read and/or written

Hierarchy

  • StorageBuffer

Index

Constructors

  • 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

  • dispose(): void
  • Disposes the storage buffer

    Returns void

  • Gets underlying native buffer

    Returns DataBuffer

    underlying native buffer

  • read(offset?: number, size?: number, buffer?: ArrayBufferView): Promise<ArrayBufferView>
  • 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

  • update(data: DataArray, byteOffset?: number, byteLength?: number): void
  • 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

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited constructor
  • Static method

Settings

Theme