readAll method

Future<List<int>> readAll()

Reads all bytes from the stream.

Returns a Future that completes with all the bytes

Implementation

Future<List<int>> readAll() async {
  List<int> result = [];
  await for (List<int> chunk in _stream) {
    result.addAll(chunk);
  }
  return result;
}