@ChannelHandler.Sharable public class Base64Decoder extends MessageToMessageDecoder<ByteBuf,ByteBuf>
ByteBuf or US-ASCII String
into a ByteBuf. Please note that this decoder must be used
with a proper ByteToMessageDecoder 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| Constructor and Description |
|---|
Base64Decoder() |
Base64Decoder(Base64Dialect dialect) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuf |
decode(ChannelHandlerContext ctx,
ByteBuf msg) |
boolean |
isDecodable(Object msg)
Returns
true if and only if the specified message can be decoded by this decoder. |
inboundBufferUpdated, newInboundBufferafterAdd, afterRemove, beforeAdd, beforeRemove, channelActive, channelInactive, channelRegistered, channelUnregistered, exceptionCaught, userEventTriggeredclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchannelActive, channelInactive, channelRegistered, channelUnregisteredafterAdd, afterRemove, beforeAdd, beforeRemove, exceptionCaught, userEventTriggeredpublic Base64Decoder()
public Base64Decoder(Base64Dialect dialect)
public boolean isDecodable(Object msg) throws Exception
MessageToMessageDecodertrue if and only if the specified message can be decoded by this decoder.isDecodable in class MessageToMessageDecoder<ByteBuf,ByteBuf>msg - the messageExceptionpublic ByteBuf decode(ChannelHandlerContext ctx, ByteBuf msg) throws Exception
decode in class MessageToMessageDecoder<ByteBuf,ByteBuf>ExceptionCopyright © 2008-2012 The Netty Project. All Rights Reserved.