length property

Future<int> get length

Returns the length of the stream (consumes the stream).

Note: This will consume the entire stream to count bytes.

Implementation

Future<int> get length async {
  int count = 0;
  await for (List<int> chunk in _stream) {
    count += chunk.length;
  }
  return count;
}