Reads the bytes in [offset, offset + length) by repeating readUpTo until the range is filled or the file ends before it.
Reads the bytes in [offset, offset + length) by repeating readUpTo until the range is filled or the file ends before it.
readUpTo(o, n) reads up ton bytes starting at absolute offset o, returning fewer only at end of file or on an interrupted read, and an empty array to signal end of file. A single underlying read is contractually allowed to return fewer bytes than requested even mid-file, so concatenating successive reads is what actually yields the full range — satisfying the exact-range contract BackwardLineReader expects of its readBlock.