org.jboss.netty.handler.codec.base64
Class Base64Decoder
java.lang.Object
org.jboss.netty.handler.codec.oneone.OneToOneDecoder
org.jboss.netty.handler.codec.base64.Base64Decoder
- All Implemented Interfaces:
- ChannelHandler, ChannelUpstreamHandler
@ChannelHandler.Sharable
public class Base64Decoder
- extends OneToOneDecoder
Decodes a Base64-encoded 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", new DelimiterBasedFrameDecoder
(80, Delimiters.nulDelimiter()
));
pipeline.addLast("base64Decoder", new Base64Decoder
());
// Encoder
pipeline.addLast("base64Encoder", new Base64Encoder
());
- Version:
- $Rev: 2241 $, $Date: 2010-04-16 13:12:43 +0900 (Fri, 16 Apr 2010) $
- Author:
- The Netty Project, Trustin Lee
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Base64Decoder
public Base64Decoder()
Base64Decoder
public Base64Decoder(Base64Dialect dialect)
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. Return
null
if the received message
is supposed to be discarded.
- Specified by:
decode
in class OneToOneDecoder
- Throws:
Exception
Copyright © 2008-2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.