addStream method

Future<void> addStream(
  1. Stream<List<int>> data
)

Feeds everything data emits, in order, and completes when it closes.

A failure in data — or in OpenSSL — propagates and leaves this digest unfinished; the caller's finally is still responsible for dispose.

Implementation

Future<void> addStream(Stream<List<int>> data) async {
  await for (final chunk in data) {
    add(chunk);
  }
}