org.springframework.messaging.converter

## Class ByteArrayMessageConverter

- java.lang.Object
- - org.springframework.messaging.converter.AbstractMessageConverter
  - - org.springframework.messaging.converter.ByteArrayMessageConverter

- All Implemented Interfaces:
    MessageConverter

      public class ByteArrayMessageConverter
      extends AbstractMessageConverter

  A `MessageConverter` that supports MIME type "application/octet-stream" with the payload converted to and from a byte[].
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Field Summary

    - ### Fields inherited from class org.springframework.messaging.converter.AbstractMessageConverter

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ByteArrayMessageConverter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `convertFromInternal(Message<?> message, Class<?> targetClass)` Convert the message payload from serialized form to an Object.
    `Object` | `convertToInternal(Object payload, MessageHeaders headers)` Convert the payload object to serialized form.
    `protected boolean` | `supports(Class<?> clazz)` Whether the given class is supported by this converter.

    - ### Methods inherited from class org.springframework.messaging.converter.AbstractMessageConverter

      `canConvertFrom, canConvertTo, fromMessage, getContentTypeResolver, getDefaultContentType, getMimeType, getSerializedPayloadClass, getSupportedMimeTypes, isStrictContentTypeMatch, setContentTypeResolver, setSerializedPayloadClass, setStrictContentTypeMatch, supportsMimeType, toMessage`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ByteArrayMessageConverter

          public ByteArrayMessageConverter()

  - ### Method Detail

    - #### supports

          protected boolean supports(Class<?> clazz)

      Description copied from class: `AbstractMessageConverter`
      Whether the given class is supported by this converter.
      Specified by:
        `supports` in class `AbstractMessageConverter`
      Parameters:
        `clazz` - the class to test for support
      Returns:
        `true` if supported; `false` otherwise

    - #### convertFromInternal

          public Object convertFromInternal(Message<?> message,
                                            Class<?> targetClass)

      Description copied from class: `AbstractMessageConverter`
      Convert the message payload from serialized form to an Object.
      Specified by:
        `convertFromInternal` in class `AbstractMessageConverter`

    - #### convertToInternal

          public Object convertToInternal(Object payload,
                                          MessageHeaders headers)

      Description copied from class: `AbstractMessageConverter`
      Convert the payload object to serialized form.
      Specified by:
        `convertToInternal` in class `AbstractMessageConverter`