read method

Future<Bytes> read(
  1. String path, {
  2. int? maxSize,
})

Implementation

Future<Bytes> read(String path, {int? maxSize}) async {
  final file = await open(
    path,
    options: const FileOptions(mode: FileMode.read, create: false),
  );
  try {
    return await file.readAll(maxSize: maxSize);
  } finally {
    await file.close();
  }
}