getFileCrc32 method Null safety

int getFileCrc32(
  1. ArchiveFile file
)

Implementation

int getFileCrc32(ArchiveFile file) {
  if (file.content == null) {
    return 0;
  }
  if (file.content is InputStreamBase) {
    var s = file.content as InputStreamBase;
    s.reset();
    var bytes = s.toUint8List();
    final crc32 = getCrc32(bytes);
    file.content.reset();
    return crc32;
  }
  return getCrc32(file.content as List<int>);
}