Class ByteBufferDecoder

All Implemented Interfaces:
Decoder<ByteBuffer>

public class ByteBufferDecoder extends AbstractDataBufferDecoder<ByteBuffer>
Decoder for ByteBuffers.
Since:
5.0
Author:
Sebastien Deleuze, Arjen Poutsma, Rossen Stoyanchev
  • Constructor Details

    • ByteBufferDecoder

      public ByteBufferDecoder()
  • Method Details

    • canDecode

      public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
      Description copied from interface: Decoder
      Whether the decoder supports the given target element type and the MIME type of the source stream.
      Specified by:
      canDecode in interface Decoder<ByteBuffer>
      Overrides:
      canDecode in class AbstractDecoder<ByteBuffer>
      Parameters:
      elementType - the target element type for the output stream
      mimeType - the mime type associated with the stream to decode (can be null if not specified)
      Returns:
      true if supported, false otherwise
    • decode

      public ByteBuffer decode(DataBuffer dataBuffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
      Description copied from interface: Decoder
      Decode a data buffer to an Object of type T. This is useful for scenarios, that distinct messages (or events) are decoded and handled individually, in fully aggregated form.
      Parameters:
      dataBuffer - the DataBuffer to decode
      elementType - the expected output type
      mimeType - the MIME type associated with the data
      hints - additional information about how to do decode
      Returns:
      the decoded value, possibly null