public static byte[] toVersionPrefixedBytes(final short version, final Message message) {
        ByteBuffer buffer = toVersionPrefixedByteBuffer(version, message);
        // take the inner array directly if it is full with data
        if (buffer.hasArray() &&
                buffer.arrayOffset() == 0 &&
                buffer.position() == 0 &&
                buffer.limit() == buffer.array().length) return buffer.array();
        else return Utils.toArray(buffer);
    }
Compare two RawTaggedFields lists.
A null list is equivalent to an empty one in this context.
clients/src/main/java/org/apache/kafka/common/protocol/MessageUtil.java