@Override
    public void write(ByteBuffer buffer, Object o) {
        if (o == null) {
            ByteUtils.writeUnsignedVarint(0, buffer);
            return;
        }
        Object[] objs = (Object[]) o;
        int size = objs.length;
        ByteUtils.writeUnsignedVarint(size + 1, buffer);

        for (Object obj : objs)
            type.write(buffer, obj);
    }
Represents a type for a compact array of a particular type.
A compact array represents its length with a varint rather than a
fixed-length field.
clients/src/main/java/org/apache/kafka/common/protocol/types/CompactArrayOf.java