public abstract class OneToOneDecoder extends Object implements ChannelUpstreamHandler
FrameDecoder
such as
DelimiterBasedFrameDecoder
or you must implement proper framing
mechanism by yourself if you are using a stream-based transport such as
TCP/IP. A typical setup for TCP/IP would be:
ChannelPipeline
pipeline = ...; // Decoders pipeline.addLast("frameDecoder", newDelimiterBasedFrameDecoder
(80,Delimiters.nulDelimiter()
)); pipeline.addLast("customDecoder", newOneToOneDecoder
() { ... }); // Encoder pipeline.addLast("customEncoder", newOneToOneEncoder
() { ... });
ChannelHandler.Sharable
Modifier | Constructor and Description |
---|---|
protected |
OneToOneDecoder()
Creates a new instance with the current system character set.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
decode(ChannelHandlerContext ctx,
Channel channel,
Object msg)
Transforms the specified received message into another message and return
the transformed message.
|
void |
handleUpstream(ChannelHandlerContext ctx,
ChannelEvent evt)
Handles the specified upstream event.
|
protected OneToOneDecoder()
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent evt) throws Exception
ChannelUpstreamHandler
handleUpstream
in interface ChannelUpstreamHandler
ctx
- the context object for this handlerevt
- the upstream event to process or interceptException
Copyright © 2008-2014 The Netty Project. All Rights Reserved.