public LogOffsetPosition searchForOffsetWithSize(long targetOffset, int startingPosition) {
        for (FileChannelRecordBatch batch : batchesFrom(startingPosition)) {
            long offset = batch.lastOffset();
            if (offset >= targetOffset)
                return new LogOffsetPosition(offset, batch.position(), batch.sizeInBytes());
        }
        return null;
    }
Search forward for the file position of the last offset that is greater than or equal to the target offset
and return its physical position and the size of the message (including log overhead) at the returned offset. If
no such offsets are found, return null.

@param targetOffset The offset to search for.
@param startingPosition The starting position in the file to begin searching from.
clients/src/main/java/org/apache/kafka/common/record/FileRecords.java