code: static final byte[] toHllByteArray(final AbstractHllArray impl, final boolean compact) {
      int auxBytes = 0;
      if (impl.tgtHllType == TgtHllType.HLL_4) {
        final AuxHashMap auxHashMap = impl.getAuxHashMap();
        if (auxHashMap != null) {
          auxBytes = (compact)
              ? auxHashMap.getCompactSizeBytes()
              : auxHashMap.getUpdatableSizeBytes();
        } else {
          auxBytes = (compact) ? 0 : 4 << LG_AUX_ARR_INTS[impl.lgConfigK];
        }
      }
      final int totBytes = HLL_BYTE_ARR_START + impl.getHllByteArrBytes() + auxBytes;
      final byte[] byteArr = new byte[totBytes];
      final WritableMemory wmem = WritableMemory.wrap(byteArr);
      insertHll(impl, wmem, compact);
      return byteArr;
    }
docs: To byte array used by the heap HLL types.