@ChannelHandler.Sharable public class Base64Decoder extends OneToOneDecoder
ChannelBuffer or US-ASCII String
into a ChannelBuffer. Please note that this decoder must be used
with a proper FrameDecoder such as DelimiterBasedFrameDecoder
if you are using a stream-based transport such as TCP/IP. A typical decoder
setup for TCP/IP would be:
ChannelPipelinepipeline = ...; // Decoders pipeline.addLast("frameDecoder", newDelimiterBasedFrameDecoder(80,Delimiters.nulDelimiter())); pipeline.addLast("base64Decoder", newBase64Decoder()); // Encoder pipeline.addLast("base64Encoder", newBase64Encoder());
ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private Base64Dialect |
dialect |
| Constructor and Description |
|---|
Base64Decoder() |
Base64Decoder(Base64Dialect dialect) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
decode(ChannelHandlerContext ctx,
Channel channel,
java.lang.Object msg)
Transforms the specified received message into another message and return
the transformed message.
|
handleUpstreamprivate final Base64Dialect dialect
public Base64Decoder()
public Base64Decoder(Base64Dialect dialect)
protected java.lang.Object decode(ChannelHandlerContext ctx, Channel channel, java.lang.Object msg) throws java.lang.Exception
OneToOneDecodernull if the received message
is supposed to be discarded.decode in class OneToOneDecoderjava.lang.Exception