slice method

  1. @override
Block slice(
  1. int start, [
  2. int? end,
  3. String? contentType
])
override

Returns a new Block containing bytes from start (inclusive) to end (exclusive), using Blob-compatible index normalization.

Implementation

@override
Block slice(int start, [int? end, String? contentType]) {
  final bounds = normalizeSliceBounds(_length, start, end);
  return FileBlock._(
    _backing,
    _offset + bounds.start,
    bounds.length,
    contentType ?? '',
  );
}