Shaku

Shaku JS

Back To Table of Content

Binary Asset

BinaryAsset

A loadable binary data asset. This asset type loads array of bytes from a remote file.

Kind: global class

binaryAsset.valid

Kind: instance property of BinaryAsset

binaryAsset.data ⇒ Uint8Array

Get binary data.

Kind: instance property of BinaryAsset
Returns: Uint8Array - Data as bytes array.

binaryAsset.load() ⇒ Promise

Load the binary data from the asset URL.

Kind: instance method of BinaryAsset
Returns: Promise - Promise to resolve when fully loaded.

binaryAsset.create(source) ⇒ Promise

Create the binary data asset from array or Uint8Array.

Kind: instance method of BinaryAsset
Returns: Promise - Promise to resolve when asset is ready.

Param Type Description
source Array.<Number> | Uint8Array Data to create asset from.

binaryAsset.destroy()

Kind: instance method of BinaryAsset

binaryAsset.string() ⇒ String

Convert and return data as string.

Kind: instance method of BinaryAsset
Returns: String - Data converted to string.