broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageConverter_v0_10_to_Internal.java [268:303]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static Object convertMessageBody(String mimeType, byte[] data)
    {
        MimeContentToObjectConverter converter = MimeContentConverterRegistry.getMimeContentToObjectConverter(mimeType);
        if (data != null && data.length != 0)
        {
            if (converter != null)
            {
                return converter.toObject(data);
            }
            else if (mimeType != null && TEXT_CONTENT_TYPES.matcher(mimeType).matches())
            {
                return new String(data, UTF_8);
            }
        }
        else if (mimeType == null)
        {
            return null;
        }
        else if (OBJECT_MESSAGE_CONTENT_TYPES.matcher(mimeType).matches())
        {
            return new byte[0];
        }
        else if (ConversionUtils.TEXT_CONTENT_TYPES.matcher(mimeType).matches())
        {
            return "";
        }
        else if (MAP_MESSAGE_CONTENT_TYPES.matcher(mimeType).matches())
        {
            return Collections.emptyMap();
        }
        else if (LIST_MESSAGE_CONTENT_TYPES.matcher(mimeType).matches())
        {
            return Collections.emptyList();
        }
        return data;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/MessageConverter_v0_8_to_Internal.java [356:391]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static Object convertMessageBody(String mimeType, byte[] data)
    {
        MimeContentToObjectConverter converter = MimeContentConverterRegistry.getMimeContentToObjectConverter(mimeType);
        if (data != null && data.length != 0)
        {
            if (converter != null)
            {
                return converter.toObject(data);
            }
            else if (mimeType != null && TEXT_CONTENT_TYPES.matcher(mimeType).matches())
            {
                return new String(data, UTF_8);
            }
        }
        else if (mimeType == null)
        {
            return null;
        }
        else if (OBJECT_MESSAGE_CONTENT_TYPES.matcher(mimeType).matches())
        {
            return new byte[0];
        }
        else if (ConversionUtils.TEXT_CONTENT_TYPES.matcher(mimeType).matches())
        {
            return "";
        }
        else if (MAP_MESSAGE_CONTENT_TYPES.matcher(mimeType).matches())
        {
            return Collections.emptyMap();
        }
        else if (LIST_MESSAGE_CONTENT_TYPES.matcher(mimeType).matches())
        {
            return Collections.emptyList();
        }
        return data;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



