@Override
    public void encode(GrowableByteBuffer buffer, Tensor tensor) {
        if ( ! ( tensor instanceof MixedTensor))
            throw new RuntimeException("The mixed format is only supported for mixed tensors");
        MixedTensor mixed = (MixedTensor) tensor;
        encodeSparseDimensions(buffer, mixed);
        encodeDenseDimensions(buffer, mixed);
        encodeCells(buffer, mixed);
    }
Implementation of a mixed binary format for a tensor.
See eval/src/vespa/eval/tensor/serialization/format.txt for format.

@author lesters
vespajlib/src/main/java/com/yahoo/tensor/serialization/MixedBinaryFormat.java