@Override
    protected void onDeserialize(Deserializer buf) {
        super.onDeserialize(buf);
        int length = buf.getInt(null);
        int compressedLength = buf.getInt(null);
        Preconditions.checkState(length == data.length,
                "Size of serialized sketch does not match expected value. Expected %s, actual %s.", data.length, length);

        if (length == compressedLength) {
            deserializeDataArray(data, length, buf);
        } else {
            LZ4FastDecompressor c = lz4Factory.fastDecompressor();
            byte[] compressedData = buf.getBytes(null, compressedLength);
            c.decompress(compressedData, data);
        }
    }
Serializes the Sketch.

Serialization format
==================
Original size:     4 bytes
Compressed size:   4 bytes
Compressed data:   N * 1 bytes

Invariant:
     compressed size &lt;= original size

Special case:
     compressed size == original size =&gt; data is uncompressed

@param buf Serializer
searchlib/src/main/java/com/yahoo/searchlib/aggregation/hll/NormalSketch.java