docs: public static final HllSketch writableWrap(final WritableMemory wmem) {
      final boolean compact = extractCompactFlag(wmem);
      if (compact) {
        throw new SketchesArgumentException(
            "Cannot perform a writableWrap of a writable sketch image that is in compact form.");
      }
      final int lgConfigK = extractLgK(wmem);
      final TgtHllType tgtHllType = extractTgtHllType(wmem);
      final long minBytes = getMaxUpdatableSerializationBytes(lgConfigK, tgtHllType);
      final long capBytes = wmem.getCapacity();
      HllUtil.checkMemSize(minBytes, capBytes);
  
      final CurMode curMode = checkPreamble(wmem);
      final HllSketch directSketch;
      if (curMode == CurMode.HLL) {
        if (tgtHllType == TgtHllType.HLL_4) {
          directSketch = new HllSketch(new DirectHll4Array(lgConfigK, wmem));
        } else if (tgtHllType == TgtHllType.HLL_6) {
          directSketch = new HllSketch(new DirectHll6Array(lgConfigK, wmem));
        } else { //Hll_8
          directSketch = new HllSketch(new DirectHll8Array(lgConfigK, wmem));
        }
      } else if (curMode == CurMode.LIST) {
        directSketch =
            new HllSketch(new DirectCouponList(lgConfigK, tgtHllType, curMode, wmem));
      } else {
        directSketch =
            new HllSketch(new DirectCouponHashSet(lgConfigK, tgtHllType, wmem));
      }
      return directSketch;
    }