encode method Null safety
- Archive archive,
- {int level = Deflate.BEST_SPEED,
- OutputStreamBase? output,
- DateTime? modified}
Implementation
List<int>? encode(Archive archive,
{int level = Deflate.BEST_SPEED,
OutputStreamBase? output,
DateTime? modified}) {
output ??= OutputStream();
startEncode(output, level: level, modified: modified);
for (final file in archive.files) {
addFile(file);
}
endEncode(comment: archive.comment);
if (output is OutputStream) {
return output.getBytes();
}
return null;
}