encode method Null safety
- Archive archive,
- {OutputStreamBase? output}
Implementation
List<int> encode(Archive archive, {OutputStreamBase? output}) {
final outputStream = output ?? OutputStream();
start(outputStream);
for (final file in archive.files) {
add(file);
}
finish();
if (outputStream is OutputStream) {
return outputStream.getBytes();
}
return [];
}