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 Object |
convertFromInternal(Message<?> message,
Class<?> targetClass,
Object conversionHint)
Convert the message payload from serialized form to an Object.
|
protected Object |
convertToInternal(Object payload,
MessageHeaders headers,
Object conversionHint)
Convert the payload object to serialized form.
|
protected boolean |
supports(Class<?> clazz)
Whether the given class is supported by this converter.
|
addSupportedMimeTypes, canConvertFrom, canConvertTo, fromMessage, fromMessage, getContentTypeResolver, getDefaultContentType, getMimeType, getSerializedPayloadClass, getSupportedMimeTypes, isStrictContentTypeMatch, setContentTypeResolver, setSerializedPayloadClass, setStrictContentTypeMatch, supportsMimeType, toMessage, toMessage
protected boolean supports(Class<?> clazz)
AbstractMessageConverter
supports
in class AbstractMessageConverter
clazz
- the class to test for supporttrue
if supported; false
otherwise@Nullable protected Object convertFromInternal(Message<?> message, @Nullable Class<?> targetClass, @Nullable 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 conversion@Nullable protected Object convertToInternal(Object payload, @Nullable MessageHeaders headers, @Nullable 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