moveNext method

  1. @override
Future<bool> moveNext()
override

Reads the tar stream up until the beginning of the next logical file.

If such file exists, the returned future will complete with true. After the future completes, the next tar entry will be evailable in current.

If no such file exists, the future will complete with false. The future might complete with an TarException if the tar stream is malformed or ends unexpectedly. If the future completes with false or an exception, the reader will cancel itself and release associated resources. Thus, it is invalid to call moveNext again in that case.

Implementation

@override
Future<bool> moveNext() async {
  await _prepareToReadHeaders();
  try {
    return await _moveNextInternal();
  } on Object {
    await cancel();
    rethrow;
  }
}