code: static boolean checkIsCompactMemory(final Memory srcMem) {
      // only reading so downcast is ok
      final int flags = extractFlags(srcMem);
      final int compactFlags = READ_ONLY_FLAG_MASK | COMPACT_FLAG_MASK;
      return (flags & compactFlags) > 0;
    }
docs: Checks just the flags field of an input Memory object. Returns true for a compact
  sketch, false for an update sketch. Does not perform additional checks, including sketch
  family.
  @param srcMem the source Memory containing a sketch
  @return true if flags indicate a compact sketch, otherwise false