Home Reference Source Test
import Atomic from 'osc-js/src/atomic.js'
public class | source

Atomic

Base class for OSC Atomic Data Types

Test:

Constructor Summary

Public Constructor
public

constructor(value: *)

Create an Atomic instance

Member Summary

Public Members
public
public

value: *

Method Summary

Public Methods
public

pack(method: string, byteLength: number): Uint8Array

Interpret the given value of this entity as packed binary data

public

unpack(dataView: DataView, method: string, byteLength: number, initialOffset: number): number

Unpack binary data from DataView according to the given format

Public Constructors

public constructor(value: *) source

Create an Atomic instance

Params:

NameTypeAttributeDescription
value *
  • optional

Initial value of any type

Public Members

public offset: number source

public value: * source

Public Methods

public pack(method: string, byteLength: number): Uint8Array source

Interpret the given value of this entity as packed binary data

Params:

NameTypeAttributeDescription
method string

The DataView method to write to the ArrayBuffer

byteLength number

Size of array in bytes

Return:

Uint8Array

Packed binary data

public unpack(dataView: DataView, method: string, byteLength: number, initialOffset: number): number source

Unpack binary data from DataView according to the given format

Params:

NameTypeAttributeDescription
dataView DataView

The DataView holding the binary representation of the value

method string

The DataView method to read the format from the ArrayBuffer

byteLength number

Size of array in bytes

initialOffset number
  • optional
  • default: 0

Offset of DataView before unpacking

Return:

number

Offset after unpacking

Test: