samsa-core

Samsa docs

SamsaBuffer object

Description

The SamsaBuffer object is a subclass of the standard JavaScript DataView. Unlike DataView it has a pointer property, p, that is updated when binary structures are read or written.

Note

For highly optimized operations, it may be better to use a Uint8Array view onto the underlying buffer of the SamsaBuffer. In this case, the client must handle the pointer during the optimized operation and update the pointer of the SamsaBuffer afterwards. But be careful of using similar multi-byte arrays such as Uint16Array and Uint32Array: their byte order is “in the platform byte order”, which for x86 and Apple M-series is little-endian, unlike TrueType which is big-endian throughout.

Constructor

SamsaBuffer()

Inherited properties

Instance properties

Instance methods

Getting and setting the buffer pointer

Reading and writing simple data types

Encoding and decoding complex data structures

Examples