public SortedIterator clone() {
            SortedIterator iter = new SortedIterator(numRecords);
            iter.position = position;
            iter.baseObject = baseObject;
            iter.baseOffset = baseOffset;
            iter.keyPrefix = keyPrefix;
            iter.recordLength = recordLength;
            return iter;
        }
Inserts a record to be sorted. Assumes that the record pointer points to a record length
stored as a 4-byte integer, followed by the record's bytes.

@param recordPointer pointer to a record in a data page, encoded by {@link TaskMemoryManager}.
@param keyPrefix     a user-defined key prefix
indexr-query-opt/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java