presto-main/src/main/java/io/prestosql/type/setdigest/SetDigest.java/SetDigest/newInstance
class SetDigest:    public static SetDigest newInstance(Slice serialized)
    {
        requireNonNull(serialized, "serialized is null");
        SliceInput input = serialized.getInput();
        checkArgument(input.readByte() == UNCOMPRESSED_FORMAT, "Unexpected version");

        int hllLength = input.readInt();
        Slice serializedHll = Slices.allocate(hllLength);
        input.readBytes(serializedHll, hllLength);
        HyperLogLog hll = HyperLogLog.newInstance(serializedHll);

        Long2ShortRBTreeMap minhash = new Long2ShortRBTreeMap();
        int maxHashes = input.readInt();
        int minhashLength = input.readInt();
        // The values are stored after the keys
        SliceInput valuesInput = serialized.getInput();
        valuesInput.setPosition(input.position() + minhashLength * SIZE_OF_LONG);

        for (int i = 0; i < minhashLength; i++) {
            minhash.put(input.readLong(), valuesInput.readShort());
        }

        return new SetDigest(maxHashes, hll, minhash);
    }