downloadRange method

  1. @override
Future<Stream<List<int>>> downloadRange(
  1. String path, {
  2. int? start,
  3. int? end,
})
override

Download a byte range from the object.

Implementation

@override
Future<Stream<List<int>>> downloadRange(
  String path, {
  int? start,
  int? end,
}) async {
  final key = _fullKey(path);
  if (start == null) {
    return download(path);
  }

  final length = end != null ? end - start : null;
  final stream = await client.getPartialObject(bucket, key, start, length);
  return stream.map((chunk) => Uint8List.fromList(chunk).toList());
}