@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:
ChannelPipeline
pipeline = ...; // Decoders pipeline.addLast("frameDecoder", newDelimiterBasedFrameDecoder
(80,Delimiters.nulDelimiter()
)); pipeline.addLast("base64Decoder", newBase64Decoder
()); // Encoder pipeline.addLast("base64Encoder", newBase64Encoder
());
ChannelHandler.Sharable
Constructor and Description |
---|
Base64Decoder() |
Base64Decoder(Base64Dialect dialect) |
Modifier and Type | Method and Description |
---|---|
protected Object |
decode(ChannelHandlerContext ctx,
Channel channel,
Object msg)
Transforms the specified received message into another message and return
the transformed message.
|
handleUpstream
public Base64Decoder()
public Base64Decoder(Base64Dialect dialect)
protected Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception
OneToOneDecoder
null
if the received message
is supposed to be discarded.decode
in class OneToOneDecoder
Exception
Copyright © 2008-2016 The Netty Project. All Rights Reserved.