Class: BufferedRead

gpf.stream. BufferedRead


new BufferedRead()

Implements IReadableStream by offering methods manipulating a buffer:

Make sure to implement the gpf.interfaces.IFlushableStream interface to complete the buffer.

Since:
  • 0.2.3
Implements:

Methods


<protected> _appendToReadBuffer(data)

Adds data to the read buffer

Parameters:
Name Type Argument Description
data * <repeatable>

Data to write

Since:
  • 0.2.3
Returns:
Self reference to allow chaining
Type
gpf.stream.BufferedRead

<protected> _completeReadBuffer()

Ends the read without any error

Since:
  • 0.2.3

<protected> _setReadError(reason)

Ends the read with an error

Parameters:
Name Type Description
reason *

Rejection reason

Since:
  • 0.2.3

read(output)

Read all data from the underlying source. Chunk of data is passed to the gpf.interfaces.IWritableStream.

Parameters:
Name Type Description
output gpf.interfaces.IWritableStream

Stream that receives chunk of data

Since:
  • 0.2.3
Implements:
Returns:

Resolved when the stream has ended

Type
Promise