code: private final int getBlockIndexForPosition(final BlockLocation[] blocks, final long offset,
  			final long halfSplitSize, final int startIndex) {
  		
  		// go over all indexes after the startIndex
  		for (int i = startIndex; i < blocks.length; i++) {
  			long blockStart = blocks[i].getOffset();
  			long blockEnd = blockStart + blocks[i].getLength();
  
  			if (offset >= blockStart && offset < blockEnd) {
  				// got the block where the split starts
  				// check if the next block contains more than this one does
  				if (i < blocks.length - 1 && blockEnd - offset < halfSplitSize) {
  					return i + 1;
  				} else {
  					return i;
  				}
  			}
  		}
  		throw new IllegalArgumentException("The given offset is not contained in the any block.");
  	}
docs: Retrieves the index of the <tt>BlockLocation</tt> that contains the part of the file described by the given
  offset.
  
  @param blocks
  The different blocks of the file. Must be ordered by their offset.
  @param offset
  The offset of the position in the file.
  @param startIndex
  The earliest index to look at.
  @return The index of the block containing the given position.