presto-main/src/main/java/io/prestosql/type/setdigest/SetDigest.java/SetDigest/serialize
class SetDigest:    public Slice serialize()
    {
        try (SliceOutput output = new DynamicSliceOutput(estimatedSerializedSize())) {
            output.appendByte(UNCOMPRESSED_FORMAT);
            Slice serializedHll = hll.serialize();
            output.appendInt(serializedHll.length());
            output.appendBytes(serializedHll);
            output.appendInt(maxHashes);
            output.appendInt(minhash.size());
            for (long key : minhash.keySet()) {
                output.appendLong(key);
            }
            for (short value : minhash.values()) {
                output.appendShort(value);
            }
            return output.slice();
        }
        catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }