code: public long getNearestPosition(long recordNumber) {
          if (recordNumber < startingRecordNumber || recordNumber > lastRecordNumber)
              throw new IndexOutOfBoundsException();
          return index.get((int) ((recordNumber - startingRecordNumber) / step));
      }
docs: Returns the nearest (from the left side, i.e. smaller) position (in bytes) to specified record number.
  
  @param recordNumber number of record
  @return nearest (from the left side, i.e. smaller) position (in bytes) to specified record number