concat<T> function

Stream<T> concat<T>(
  1. Iterable<Stream<T>> streams
)

Returns the concatenation of the input streams.

When the returned stream is listened to, the streams are iterated through asynchronously, forwarding all events (both data and error) for the current stream to the returned stream before advancing the iterator and listening to the next stream. If advancing the iterator throws an error, the returned stream ends immediately with that error.

Pausing and resuming the returned stream's subscriptions will pause and resume the subscription of the current stream being listened to.

Note: Events from pre-existing broadcast streams which occur before the stream is reached by the iteration will be dropped.

Example:

concat(files.map((file) =>
    file.openRead().transform(const LineSplitter())))

Implementation

Stream<T> concat<T>(Iterable<Stream<T>> streams) => _ConcatStream(streams);