Dart API Referencedart:ioChunkedInputStream

ChunkedInputStream Interface

A chunked input stream wraps a basic input stream and supplies binary data in configurable chunk sizes.

Constructors

Code new ChunkedInputStream(InputStream input, [int chunkSize]) #

Adds buffering to an input stream and provide the ability to read the data in known size chunks.

ChunkedInputStream(InputStream input, [int chunkSize]);

Methods

Code int get chunkSize() #

Returns the chunk size used by this stream.

int get chunkSize();

Code void set chunkSize(int chunkSize) #

Sets the chunk size used by this stream.

void set chunkSize(int chunkSize);

Code bool get closed() #

Returns whether the stream has been closed. There might still be more data to read.

bool get closed();

Code void set onClosed(void callback()) #

Sets the handler that gets called when there will be no more data available in the stream.

void set onClosed(void callback());

Code void set onData(void callback()) #

Sets the handler that gets called when at least chunkSize bytes of data is available or the underlying stream has been closed and there is still unread data.

void set onData(void callback());

Code void set onError(void callback(e)) #

Sets the handler that gets called when the underlying communication channel gets into some kind of error situation.

void set onError(void callback(e));

Code List<int> read() #

Reads chunkSize bytes from the stream. If chunkSize bytes are not currently available null is returned. When the stream is closed the last call can return with less than chunkSize bytes.

List<int> read();