buffered_list_stream 1.0.1 copy "buffered_list_stream: ^1.0.1" to clipboard
buffered_list_stream: ^1.0.1 copied to clipboard

outdated

Buffer a [Stream<List<T>>]. Useful for IO operations.

pub package Build Status

Buffer a Stream<List<T>>. Useful for IO operations.

Usage #

Install and import this package:

import 'package:buffered_list_stream/buffered_list_stream.dart';

Example:

Stream<List<int>> getStream() async* {
  yield [1, 2];
  yield [3];
  yield [4, 5];
  yield [6, 7];
  yield [8, 9, 10];
}

void main() async {
  var bufferedString = bufferedListStream(getStream(), 3);
  await for (var chunk in bufferedString) {
    // ignore: avoid_print
    print(chunk);
  }
  /**
    [1, 2, 3]
    [4, 5, 6, 7]
    [8, 9, 10]
   */
}