code: @Override
  	public int compare(int i, int j) {
  		final int bufferNumI = i / this.recordsPerSegment;
  		final int segmentOffsetI = (i % this.recordsPerSegment) * this.recordSize;
  		
  		final int bufferNumJ = j / this.recordsPerSegment;
  		final int segmentOffsetJ = (j % this.recordsPerSegment) * this.recordSize;
  		
  		final MemorySegment segI = this.sortBuffer.get(bufferNumI);
  		final MemorySegment segJ = this.sortBuffer.get(bufferNumJ);
  		
  		int val = MemorySegment.compare(segI, segJ, segmentOffsetI, segmentOffsetJ, this.numKeyBytes);
  		return this.useNormKeyUninverted ? val : -val;
  	}
docs: -------------------------------------------------------------------------