Class: Chunk

Chunk

new Chunk(data, stream)

Parameters:
Name Type Description
data Buffer initial data
stream stream.Readable stream to read from
Source:

Methods

hasNext() → {boolean}

Checks whether there are more chunks to read.
Source:
Returns:
- false if end of stream
Type
boolean

next(onSuccess, onFailure) → {Promise}

Reads the next chunk in the stream.
Parameters:
Name Type Description
onSuccess function the handler to call on success
onFailure function the handler to call on failure
Source:
Returns:
- a promise, resolved on success, rejected on failure
Type
Promise