code: public void putMemory(final WritableMemory dstMem, final ArrayOfItemsSerDe<T> serDe) {
      final byte[] byteArr = toByteArray(serDe);
      final long memCap = dstMem.getCapacity();
      if (memCap < byteArr.length) {
        throw new SketchesArgumentException(
            "Destination Memory not large enough: " + memCap + " < " + byteArr.length);
      }
      dstMem.putByteArray(0, byteArr, 0, byteArr.length);
    }
docs: Puts the current sketch into the given Memory if there is sufficient space.
  Otherwise, throws an error.
  
  @param dstMem the given memory.
  @param serDe an instance of ArrayOfItemsSerDe