Implement a custom RandomAccessReader
masterTo use fromRandomAccessReader(), you must subclass RandomAccessReader and implement the _readStreamForRange(start, end) method.
Implementation Requirements:
startandendareNumberbyte offsets.endis exclusive.- The method must return a
ReadableStreamthat can bepipe()ed. - The stream should provide data in chunks. If the stream provides too many or too few bytes for the requested range, an error will be emitted.
class MyReader extends RandomAccessReader {
_readStreamForRange(start, end) {
// Return a readable stream for the range [start, end)
// ...
}
}