@ChannelHandler.Sharable public class Base64Encoder extends MessageToMessageEncoder<io.netty.buffer.ByteBuf>
ByteBuf into a Base64-encoded ByteBuf.
A typical setup for TCP/IP would be:
ChannelPipelinepipeline = ...; // Decoders pipeline.addLast("frameDecoder", newDelimiterBasedFrameDecoder(80,Delimiters.nulDelimiter())); pipeline.addLast("base64Decoder", newBase64Decoder()); // Encoder pipeline.addLast("base64Encoder", newBase64Encoder());
| Constructor and Description |
|---|
Base64Encoder() |
Base64Encoder(boolean breakLines) |
Base64Encoder(boolean breakLines,
Base64Dialect dialect) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
encode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf msg)
Encode from one message to an other.
|
flushacceptOutboundMessage, beginFlush, endFlush, flush, freeOutboundBuffer, isCloseOnFailedFlush, newOutboundBuffer, setCloseOnFailedFlushbind, close, connect, deregister, disconnect, read, sendFileafterAdd, afterRemove, beforeAdd, beforeRemove, exceptionCaught, userEventTriggeredclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic Base64Encoder()
public Base64Encoder(boolean breakLines)
public Base64Encoder(boolean breakLines,
Base64Dialect dialect)
protected Object encode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf msg) throws Exception
MessageToMessageEncoderMessageBuf has nothing
left or till this method returns null.encode in class MessageToMessageEncoder<io.netty.buffer.ByteBuf>ctx - the ChannelHandlerContext which this MessageToMessageEncoder belongs tomsg - the message to encode to an other onenull if more messages are needed be cause the implementation
needs to do some kind of aggragationException - is thrown if an error accourCopyright © 2008-2013 The Netty Project. All Rights Reserved.