isEOF method

Future<bool> isEOF()

Check if we're at end of file.

Implementation

Future<bool> isEOF() async {
  while (_curr == null || _pos == _curr!.length) {
    final ok = await _source.moveNext();
    if (!ok) {
      return true;
    }
    if (_source.current is Uint8List) {
      _curr = _source.current as Uint8List;
    } else {
      _curr = Uint8List.fromList(_source.current);
    }
    _pos = 0;
    // Loop around again, in case we got an empty buffer.
  }
  return false;
}