chunked_stream library

Utilities for working with chunked streams.

This library provides the following utilities:

Classes

ChunkedStreamIterator<T>
Auxiliary class for iterating over the items in a chunked stream.

Extensions

ChunkedStreamIteratorByteStreamExt on ChunkedStreamIterator<int>
Extension methods for ChunkedStreamIterator when working with byte-streams Stream<List<int>>.

Functions

asChunkedStream<T>(int N, Stream<T> input) Stream<List<T>>
Wrap input as a chunked stream with chunks the size of N.
bufferChunkedStream<T>(Stream<List<T>> input, {int bufferSize = 16 * 1024}) Stream<List<T>>
Buffer an chunked stream.
limitChunkedStream<T>(Stream<List<T>> input, {int? maxSize}) Stream<List<T>>
Create a chunked stream limited to the first maxSize items from input.
readByteStream(Stream<List<int>> input, {int? maxSize}) Future<Uint8List>
Read all bytes from input and return a Uint8List consisting of all bytes from input.
readChunkedStream<T>(Stream<List<T>> input, {int? maxSize}) Future<List<T>>
Read all chunks from input and return a list consisting of items from all chunks.

Exceptions / Errors

MaximumSizeExceeded
Exception thrown if maxSize was exceeded while reading a chunked stream.