forEach static method
Utility function for quickly iterating through all entries in tarStream
.
Implementation
static Future<void> forEach(Stream<List<int>> tarStream,
FutureOr<void> Function(TarEntry entry) action) async {
final reader = TarReader(tarStream);
try {
while (await reader.moveNext()) {
await action(reader.current);
}
} finally {
await reader.cancel();
}
}