head property

  1. @override
List<int> get head
override

the first bytes of the file. @Mimes and @Image read the real file type from them.

Implementation

@override
List<int> get head {
  List<int>? known = _head;
  if (known != null) return known;
  Uint8List? memory = _bytes;
  if (memory == null) return const <int>[];
  return memory.length > FileTypes.headSize
      ? Uint8List.sublistView(memory, 0, FileTypes.headSize)
      : memory;
}