entriesOf method

List<Uint8List> entriesOf(
  1. Uint8List bytes
)

The images this archive holds, in order, without decoding their ASTs.

Implementation

List<Uint8List> entriesOf(Uint8List bytes) {
  var container = ASTBinaryContainerCodec.decode(
    bytes,
    verifyChecksum: verifyChecksum,
    verifier: verifier,
  );

  if (!container.header.hasArchiveFlag) {
    throw ASTBinaryException(
      'This is a single binary AST image, not an archive.',
      ASTBinaryError.malformedSection,
      formatVersion: container.header.formatVersion,
    );
  }

  return [
    for (var s in container.sections)
      if (s.id == ASTBinarySection.archiveEntry.id) s.payload,
  ];
}