code: public static final HllSketch wrap(final Memory srcMem) {
      final int lgConfigK = extractLgK(srcMem);
      final TgtHllType tgtHllType = extractTgtHllType(srcMem);
  
      final CurMode curMode = checkPreamble(srcMem);
      final HllSketch directSketch;
      if (curMode == CurMode.HLL) {
        if (tgtHllType == TgtHllType.HLL_4) {
          directSketch = new HllSketch(new DirectHll4Array(lgConfigK, srcMem));
        } else if (tgtHllType == TgtHllType.HLL_6) {
          directSketch = new HllSketch(new DirectHll6Array(lgConfigK, srcMem));
        } else { //Hll_8
          directSketch = new HllSketch(new DirectHll8Array(lgConfigK, srcMem));
        }
      } else if (curMode == CurMode.LIST) {
        directSketch =
            new HllSketch(new DirectCouponList(lgConfigK, tgtHllType, curMode, srcMem));
      } else { //SET
        directSketch =
            new HllSketch(new DirectCouponHashSet(lgConfigK, tgtHllType, srcMem));
      }
      return directSketch;
    }
docs: Wraps the given read-only Memory that must be a image of a valid sketch,
  which may be in compact or updatable form, and should have data. Any attempt to update this
  sketch will throw an exception.
  @param srcMem a read-only image of a valid sketch.
  @return an HllSketch, where the read-only data of the sketch is in the given srcMem.