// We sort position by pointed document pointer.
LongArrays.quickSort( position, 0, documentCount, new AbstractLongComparator() {
public int compare( final long position0, final long position1 ) {
try {
ibs.position( position0 );
final int d0 = ibs.readDelta();
ibs.position( position1 );
return d0 - ibs.readDelta();
}
catch ( IOException e ) {
throw new RuntimeException( e );