readAsBytes method

Future<List<int>> readAsBytes()

Read the content of the file as a list of bytes.

Can only be called once.

Implementation

Future<List<int>> readAsBytes() async {
  return (await _byteStream.toList())
      .fold<List<int>>([], (p, e) => p..addAll(e));
}