code: public void insertKVRecord(Object keyBase, long keyOffset, int keyLen,
        Object valueBase, long valueOffset, int valueLen, long prefix, boolean prefixIsNull)
      throws IOException {
  
      growPointerArrayIfNecessary();
      int uaoSize = UnsafeAlignedOffset.getUaoSize();
      final int required = keyLen + valueLen + (2 * uaoSize);
      acquireNewPageIfNecessary(required);
  
      final Object base = currentPage.getBaseObject();
      final long recordAddress = taskMemoryManager.encodePageNumberAndOffset(currentPage, pageCursor);
      UnsafeAlignedOffset.putSize(base, pageCursor, keyLen + valueLen + uaoSize);
      pageCursor += uaoSize;
      UnsafeAlignedOffset.putSize(base, pageCursor, keyLen);
      pageCursor += uaoSize;
      Platform.copyMemory(keyBase, keyOffset, base, pageCursor, keyLen);
      pageCursor += keyLen;
      Platform.copyMemory(valueBase, valueOffset, base, pageCursor, valueLen);
      pageCursor += valueLen;
  
      assert(inMemSorter != null);
      inMemSorter.insertRecord(recordAddress, prefix, prefixIsNull);
    }
docs: Write a key-value record to the sorter. The key and value will be put together in-memory,
  using the following format:
  
  record length (4 bytes), key length (4 bytes), key data, value data
  
  record length = key length + value length + 4