Class AbstractNioBufferReactorNettyCodec<P>
- java.lang.Object
- org.springframework.messaging.tcp.reactor.AbstractNioBufferReactorNettyCodec<P>
- Type Parameters:
P
- the message payload type
- All Implemented Interfaces:
ReactorNettyCodec<P>
- Direct Known Subclasses:
StompReactorNettyCodec
public abstract class AbstractNioBufferReactorNettyCodec<P> extends Object implements ReactorNettyCodec<P>
Convenient base class forReactorNettyCodec
implementations that need to work with NIOByteBuffers
.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Constructor Description AbstractNioBufferReactorNettyCodec()
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Collection<Message<P>>
decode(io.netty.buffer.ByteBuf inputBuffer)
Decode the inputByteBuf
into one or moreMessages
.protected abstract List<Message<P>>
decodeInternal(ByteBuffer nioBuffer)
void
encode(Message<P> message, io.netty.buffer.ByteBuf outputBuffer)
Encode the givenMessage
to the outputByteBuf
.protected abstract ByteBuffer
encodeInternal(Message<P> message)
Constructor Detail
AbstractNioBufferReactorNettyCodec
public AbstractNioBufferReactorNettyCodec()
Method Detail
decode
public Collection<Message<P>> decode(io.netty.buffer.ByteBuf inputBuffer)
Description copied from interface:ReactorNettyCodec
Decode the inputByteBuf
into one or moreMessages
.- Specified by:
decode
in interfaceReactorNettyCodec<P>
- Parameters:
inputBuffer
- the input buffer to decode from- Returns:
- 0 or more decoded messages
encode
public void encode(Message<P> message, io.netty.buffer.ByteBuf outputBuffer)
Description copied from interface:ReactorNettyCodec
Encode the givenMessage
to the outputByteBuf
.- Specified by:
encode
in interfaceReactorNettyCodec<P>
- Parameters:
message
- the message to encodeoutputBuffer
- the buffer to write to
decodeInternal
protected abstract List<Message<P>> decodeInternal(ByteBuffer nioBuffer)
encodeInternal
protected abstract ByteBuffer encodeInternal(Message<P> message)