code: static final void moveAndResize(final Memory srcMem, final int preambleLongs,
        final int srcLgArrLongs, final WritableMemory dstMem, final int dstLgArrLongs, final long thetaLong) {
      //Note: This copies the Memory data onto the heap and then at the end copies the result
      // back to Memory. Even if we tried to do this directly into Memory it would require pre-clearing,
      // and the internal loops would be slower. The bulk copies are performed at a low level and
      // are quite fast. Measurements reveal that we are not paying much of a penalty.
  
      //Move Preamble to destination memory
      final int preBytes = preambleLongs << 3;
      srcMem.copyTo(0, dstMem, 0, preBytes); //copy the preamble
  
      //Bulk copy source to on-heap buffer
      final int srcHTLen = 1 << srcLgArrLongs;
      final long[] srcHTArr = new long[srcHTLen];
      srcMem.getLongArray(preBytes, srcHTArr, 0, srcHTLen);
  
      //Create destination buffer
      final int dstHTLen = 1 << dstLgArrLongs;
      final long[] dstHTArr = new long[dstHTLen];
  
      //Rebuild hash table in destination buffer
      HashOperations.hashArrayInsert(srcHTArr, dstHTArr, dstLgArrLongs, thetaLong);
  
      //Bulk copy to destination memory
      dstMem.putLongArray(preBytes, dstHTArr, 0, dstHTLen);
      dstMem.putByte(LG_ARR_LONGS_BYTE, (byte)dstLgArrLongs); //update in dstMem
    }
docs: Moves me (the entire sketch) to a new larger Memory location and rebuilds the hash table.
  This assumes a Memory preamble of standard form with the correct value of thetaLong.
  Afterwards, the caller must update the local Memory reference, lgArrLongs
  and hashTableThreshold from the dstMemory and free the source Memory.
  
  @param srcMem the source Memory
  @param preambleLongs size of preamble in longs
  @param srcLgArrLongs size (log_base2) of source hash table
  @param dstMem the destination Memory, which may be garbage
  @param dstLgArrLongs the destination hash table target size
  @param thetaLong theta as a long