Options
All
  • Public
  • Public/Protected
  • All
Menu

A subclass of Serializer that serializes TypedArray (in particular Buffer) and DataView objects as host objects, and only stores the part of their underlying ArrayBuffers that they are referring to.

Hierarchy

Index

Constructors

constructor

Methods

getWireFormatVersion

  • getWireFormatVersion(): number
  • Reads the underlying wire format version. Likely mostly to be useful to legacy code reading old wire format versions. May not be called before .readHeader().

    Returns number

readDouble

  • readDouble(): number
  • Read a JS number value.

    Returns number

readHeader

  • readHeader(): boolean
  • Reads and validates a header (including the format version). May, for example, reject an invalid or unsupported wire format. In that case, an Error is thrown.

    Returns boolean

readRawBytes

  • readRawBytes(length: number): Buffer
  • Read raw bytes from the deserializer’s internal buffer. The length parameter must correspond to the length of the buffer that was passed to serializer.writeRawBytes().

    Parameters

    • length: number

    Returns Buffer

readUint32

  • readUint32(): number
  • Read a raw 32-bit unsigned integer and return it.

    Returns number

readUint64

  • readUint64(): [number, number]
  • Read a raw 64-bit unsigned integer and return it as an array [hi, lo] with two 32-bit unsigned integer entries.

    Returns [number, number]

readValue

  • readValue(): any
  • Deserializes a JavaScript value from the buffer and returns it.

    Returns any

transferArrayBuffer

  • transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void
  • Marks an ArrayBuffer as having its contents transferred out of band. Pass the corresponding ArrayBuffer in the serializing context to serializer.transferArrayBuffer() (or return the id from serializer._getSharedArrayBufferId() in the case of SharedArrayBuffers).

    Parameters

    • id: number
    • arrayBuffer: ArrayBuffer

    Returns void

Generated using TypeDoc