@Override
    public ClusterStateBundle decodeWithEnvelope(byte[] encodedClusterStateBundle) {
        // We expect ZK writes to be atomic, letting us not worry about partially written or corrupted blobs.
        Slime slime = BinaryFormat.decode(encodedClusterStateBundle);
        Inspector root = slime.get();
        CompressionType compressionType = CompressionType.valueOf((byte)root.field("compression-type").asLong());
        int uncompressedSize = (int)root.field("uncompressed-size").asLong();
        byte[] data = root.field("data").asData();
        return decode(EncodedClusterStateBundle.fromCompressionBuffer(
                new Compressor.Compression(compressionType, uncompressedSize, data)));
    }
Implementation of ClusterStateBundleCodec which uses structured Slime binary encoding
to implement (de-)serialization of ClusterStateBundle instances. Encoding format is
intentionally extensible so that we may add other information to it later.

LZ4 compression is transparently applied during encoding and decompression is
subsequently applied during decoding.

Implements optional Slime-based enveloping for *WithEnvelope methods, which removes
need to explicitly track compression metadata by the caller.
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/rpc/SlimeClusterStateBundleCodec.java