private static DiskRangeList findIntersectingPosition(
      DiskRangeList ranges, long offset, long end) {
    if (offset < 0) return ranges;
    ranges = findUpperBound(ranges, offset);
    ranges = findLowerBound(ranges, end);
    // We are now on some intersecting buffer, find the first intersecting buffer.
    while (ranges.prev != null && ranges.prev.getEnd() > offset) {
      if (ranges.prev.getEnd() > ranges.getOffset()) {
        throwRangesError(ranges, offset, end);
      }
      ranges = ranges.prev;
    }
    return ranges;
  }
Finds compressed offset in a stream and makes sure iter points to its position.
     This may be necessary for obscure combinations of compression and encoding boundaries.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java