public class ByteArrayMessageConverter extends AbstractMessageConverter
MessageConverter
that supports MIME type "application/octet-stream" with the
payload converted to and from a byte[].logger
Constructor and Description |
---|
ByteArrayMessageConverter() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
convertFromInternal(Message<?> message,
java.lang.Class<?> targetClass,
java.lang.Object conversionHint)
Convert the message payload from serialized form to an Object.
|
protected java.lang.Object |
convertToInternal(java.lang.Object payload,
MessageHeaders headers,
java.lang.Object conversionHint)
Convert the payload object to serialized form.
|
protected boolean |
supports(java.lang.Class<?> clazz)
Whether the given class is supported by this converter.
|
canConvertFrom, canConvertTo, convertFromInternal, convertToInternal, fromMessage, fromMessage, getContentTypeResolver, getDefaultContentType, getMimeType, getSerializedPayloadClass, getSupportedMimeTypes, isStrictContentTypeMatch, setContentTypeResolver, setSerializedPayloadClass, setStrictContentTypeMatch, supportsMimeType, toMessage, toMessage
protected boolean supports(java.lang.Class<?> clazz)
AbstractMessageConverter
supports
in class AbstractMessageConverter
clazz
- the class to test for supporttrue
if supported; false
otherwiseprotected java.lang.Object convertFromInternal(Message<?> message, java.lang.Class<?> targetClass, java.lang.Object conversionHint)
AbstractMessageConverter
convertFromInternal
in class AbstractMessageConverter
message
- the input messagetargetClass
- the target class for the conversionconversionHint
- an extra object passed to the MessageConverter
,
e.g. the associated MethodParameter
(may be null
}null
if the converter cannot
perform the conversionprotected java.lang.Object convertToInternal(java.lang.Object payload, MessageHeaders headers, java.lang.Object conversionHint)
AbstractMessageConverter
convertToInternal
in class AbstractMessageConverter
payload
- the Object to convertheaders
- optional headers for the message (may be null
)conversionHint
- an extra object passed to the MessageConverter
,
e.g. the associated MethodParameter
(may be null
}null
if the converter
cannot perform the conversion