}
OffHeapLongArray indices = new OffHeapLongArray(toIndex - fromIndex);
for (long i = fromIndex; i < toIndex; i++) {
indices.set(i, i);
}
OffHeapLongComparator indexComp = new OffHeapReferenceComparator(a, comparator);
OffHeapLongSorter.sort(indices, indexComp);
return new ReferenceIterable(a, indices);
}