isArchive static method

bool isArchive(
  1. Uint8List bytes
)

Whether bytes is an archive rather than a single-unit image.

Implementation

static bool isArchive(Uint8List bytes) {
  if (!ASTBinaryFormat.isASTBinary(bytes) ||
      bytes.length < ASTBinaryFormat.headerSize) {
    return false;
  }
  var flags =
      ((bytes[8] << 24) | (bytes[9] << 16) | (bytes[10] << 8) | bytes[11]) >>>
      0;
  return (flags & ASTBinaryFlags.archive) != 0;
}