openRange static method

Future<FileBlock> openRange(
  1. File file, {
  2. required int offset,
  3. required int length,
  4. String type = '',
})

Opens a byte range of file as a lazy, file-backed Block.

Implementation

static Future<FileBlock> openRange(
  File file, {
  required int offset,
  required int length,
  String type = '',
}) async {
  final totalSize = await file.length();
  _validateRange(totalSize, offset, length);
  return _openWithKnownSize(
    file,
    totalSize: totalSize,
    offset: offset,
    length: length,
    type: type,
  );
}