Options
All
  • Public
  • Public/Protected
  • All
Menu

A convenience class for unpacking and packing. {@link struct]

Type parameters

  • T: StructDef

Hierarchy

  • Struct

Constructors

Methods

Constructors

constructor

  • new Struct(descr: T): Struct

Parameters

  • descr: T

    The descriptor.

Returns Struct

Methods

pack

  • pack(o: UnpackMap<T>): Uint8Array

Repacks the object into an Uint8Array. Undoes Struct.unpack

Parameters

  • o: UnpackMap<T>

    The object to be repacked

Returns Uint8Array

The result of packing

unpack

  • unpack(bin: DataArray): UnpackMap<T>

Unpack DataArray into an object. Undoes Struct.pack

Parameters

  • bin: DataArray

    The DataArray to be unpacked

Returns UnpackMap<T>

Unpacked version of bin

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.