stream method

  1. @override
Future<Stream<List<int>>> stream()
override

Raw bytes stream of the content.

A byte stream can be useful when sniffers only need to read a few bytes at the beginning of the file.

Implementation

@override
Future<Stream<List<int>>> stream() async {
  if (file is File) {
    try {
      return (file as File).openRead();
    } on Exception catch (ex) {
      Fimber.e("ERROR reading file: $file", ex: ex);
      return Stream.empty();
    }
  }
  return Stream.empty();
}