docs: public static Sketch wrap(final Memory srcMem, final long seed) {
      final int  preLongs = srcMem.getByte(PREAMBLE_LONGS_BYTE) & 0X3F;
      final int serVer = srcMem.getByte(SER_VER_BYTE) & 0XFF;
      final int familyID = srcMem.getByte(FAMILY_BYTE) & 0XFF;
      final Family family = Family.idToFamily(familyID);
      switch (family) {
        case QUICKSELECT: { //Hash Table structure
          if ((serVer == 3) && (preLongs == 3)) {
            return DirectQuickSelectSketchR.readOnlyWrap(srcMem, seed);
          } else {
            throw new SketchesArgumentException(
                "Corrupted: " + family + " family image: must have SerVer = 3 and preLongs = 3");
          }
        }
        case COMPACT: { //serVer 1, 2, or 3, preLongs = 1, 2, or 3
          if (serVer == 1) {
            return ForwardCompatibility.heapify1to3(srcMem, seed);
          }
          else if (serVer == 2) {
            return ForwardCompatibility.heapify2to3(srcMem, seed);
          }
          final int flags = srcMem.getByte(FLAGS_BYTE);
          final boolean compact = (flags & COMPACT_FLAG_MASK) > 0; //used for corruption check
          final boolean ordered = (flags & ORDERED_FLAG_MASK) > 0;
          if (compact) {
              return ordered ? DirectCompactOrderedSketch.wrapInstance(srcMem, seed)
                             : DirectCompactUnorderedSketch.wrapInstance(srcMem, seed);
          }
          throw new SketchesArgumentException(
              "Corrupted: " + family + " family image must have compact flag set");
        }
        default: throw new SketchesArgumentException(
            "Sketch cannot wrap family: " + family + " as a Sketch");
      }
    }