Class Base64Decoder
- java.lang.Object
-
- org.jboss.netty.handler.codec.oneone.OneToOneDecoder
-
- org.jboss.netty.handler.codec.base64.Base64Decoder
-
- All Implemented Interfaces:
ChannelHandler
,ChannelUpstreamHandler
@Sharable public class Base64Decoder extends OneToOneDecoder
Decodes a Base64-encodedChannelBuffer
or US-ASCIIString
into aChannelBuffer
. Please note that this decoder must be used with a properFrameDecoder
such asDelimiterBasedFrameDecoder
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
());
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Constructor Summary
Constructors Constructor Description Base64Decoder()
Base64Decoder(Base64Dialect dialect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
decode(ChannelHandlerContext ctx, Channel channel, Object msg)
Transforms the specified received message into another message and return the transformed message.-
Methods inherited from class org.jboss.netty.handler.codec.oneone.OneToOneDecoder
handleUpstream
-
-
-
-
Constructor Detail
-
Base64Decoder
public Base64Decoder()
-
Base64Decoder
public Base64Decoder(Base64Dialect dialect)
-
-
Method Detail
-
decode
protected Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception
Description copied from class:OneToOneDecoder
Transforms the specified received message into another message and return the transformed message. Returnnull
if the received message is supposed to be discarded.- Specified by:
decode
in classOneToOneDecoder
- Throws:
Exception
-
-