Top Description Methods
org.springframework.messaging.tcp.reactor

public Interface TcpMessageCodec<P>

Known Direct Implementers
org.springframework.messaging.simp.stomp.StompTcpMessageCodec
Type Parameters
<P>
the message payload type
Imports
java.nio.ByteBuffer, java.util.List, org.springframework.messaging.Message

Contract to encode and decode a Message to and from a ByteBuffer allowing a higher-level protocol (e.g. STOMP over TCP) to plug in.
Author
Rossen Stoyanchev
Since
6.0

Method Summary

Modifier and TypeMethod and Description
public List<Message<P>>

Returns:

0 or more decoded messages
decode
(ByteBuffer
the input buffer to decode from
buffer
)

Decode the input ByteBuffer into one or more Messages.

public ByteBuffer

Returns:

the encoded buffer
encode
(Message<P>
the message to encode
message
)

Encode the given Message to the output ByteBuffer.

Method Detail

decodeback to summary
public List<Message<P>> decode(ByteBuffer buffer)

Decode the input ByteBuffer into one or more Messages.

Parameters
buffer:ByteBuffer

the input buffer to decode from

Returns:List<Message<P>>

0 or more decoded messages

encodeback to summary
public ByteBuffer encode(Message<P> message)

Encode the given Message to the output ByteBuffer.

Parameters
message:Message<P>

the message to encode

Returns:ByteBuffer

the encoded buffer