readAsBytesSync method

  1. @override
Uint8List readAsBytesSync()
override

Synchronously reads the entire file contents as a list of bytes.

Throws a FileSystemException if the operation fails.

Implementation

@override
Uint8List readAsBytesSync() {
  final file = assertIsFile<MemoryFileImplementation>(
    _fs,
    path,
    'Cannot open file',
  );

  return Uint8List.fromList(file.bytes);
}