docs: public static LongsSketch getInstance(final Memory srcMem) {
      final long pre0 = PreambleUtil.checkPreambleSize(srcMem); //make sure preamble will fit
      final int maxPreLongs = Family.FREQUENCY.getMaxPreLongs();
  
      final int preLongs = extractPreLongs(pre0);         //Byte 0
      final int serVer = extractSerVer(pre0);             //Byte 1
      final int familyID = extractFamilyID(pre0);         //Byte 2
      final int lgMaxMapSize = extractLgMaxMapSize(pre0); //Byte 3
      final int lgCurMapSize = extractLgCurMapSize(pre0); //Byte 4
      final boolean empty = (extractFlags(pre0) & EMPTY_FLAG_MASK) != 0; //Byte 5
  
      // Checks
      final boolean preLongsEq1 = (preLongs == 1);        //Byte 0
      final boolean preLongsEqMax = (preLongs == maxPreLongs);
      if (!preLongsEq1 && !preLongsEqMax) {
        throw new SketchesArgumentException(
            "Possible Corruption: PreLongs must be 1 or " + maxPreLongs + ": " + preLongs);
      }
      if (serVer != SER_VER) {                            //Byte 1
        throw new SketchesArgumentException(
            "Possible Corruption: Ser Ver must be " + SER_VER + ": " + serVer);
      }
      final int actFamID = Family.FREQUENCY.getID();      //Byte 2
      if (familyID != actFamID) {
        throw new SketchesArgumentException(
            "Possible Corruption: FamilyID must be " + actFamID + ": " + familyID);
      }
      if (empty ^ preLongsEq1) {                          //Byte 5 and Byte 0
        throw new SketchesArgumentException(
            "Possible Corruption: (PreLongs == 1) ^ Empty == True.");
      }
  
      if (empty) {
        return new LongsSketch(lgMaxMapSize, LG_MIN_MAP_SIZE);
      }
      //get full preamble
      final long[] preArr = new long[preLongs];
      srcMem.getLongArray(0, preArr, 0, preLongs);
  
      final LongsSketch fls = new LongsSketch(lgMaxMapSize, lgCurMapSize);
      fls.streamWeight = 0; //update after
      fls.offset = preArr[3];
  
      final int preBytes = preLongs << 3;
      final int activeItems = extractActiveItems(preArr[1]);
      //Get countArray
      final long[] countArray = new long[activeItems];
      srcMem.getLongArray(preBytes, countArray, 0, activeItems);
      //Get itemArray
      final int itemsOffset = preBytes + (8 * activeItems);
      final long[] itemArray = new long[activeItems];
      srcMem.getLongArray(itemsOffset, itemArray, 0, activeItems);
      //update the sketch
      for (int i = 0; i < activeItems; i++) {
        fls.update(itemArray[i], countArray[i]);
      }
      fls.streamWeight = preArr[2]; //override streamWeight due to updating
      return fls;
    }