private OptionalInt toRelative(long offset) {
        long relativeOffset = offset - baseOffset;
        if (relativeOffset < 0 || relativeOffset > Integer.MAX_VALUE)
            return OptionalInt.empty();
        else
            return OptionalInt.of((int) relativeOffset);
    }
Lookup lower or upper bounds for the given target.
storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java