Class: BlockedSource

source~BlockedSource(retrievalFunction, options)

BlockedSource - an abstraction of (remote) files.

Constructor

new BlockedSource(retrievalFunction, options)

Parameters:
Name Type Description
retrievalFunction requestCallback

Callback function to request data

options object

Additional options

Properties
Name Type Description
blockSize object

Size of blocks to be fetched

Implements:
Source:

Methods

(async) fetch(offset, length) → {ArrayBuffer}

Fetch a subset of the file.

Parameters:
Name Type Description
offset number

The offset within the file to read from.

length number

The length in bytes to read from.

Implements:
Source:
Returns:

The subset of the file.

Type
ArrayBuffer