Class ZlibEncoder
java.lang.Object
- All Implemented Interfaces:
ChannelHandler, ChannelOutboundHandler
- Direct Known Subclasses:
JdkZlibEncoder, JZlibEncoder
Compresses a
ByteBuf using the deflate algorithm.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.SharableModifier and TypeInterfaceDescriptionstatic @interfaceIndicates that the same instance of the annotatedChannelHandlercan be added to one or moreChannelPipelines multiple times without a race condition. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ChannelFutureclose()Close thisZlibEncoderand so finish the encoding.abstract ChannelFutureclose(ChannelPromise promise) Close thisZlibEncoderand so finish the encoding.abstract booleanisClosed()Returnstrueif and only if the end of the compressed stream has been reached.Methods inherited from class MessageToByteEncoder
acceptOutboundMessage, allocateBuffer, encode, isPreferDirect, writeModifier and TypeMethodDescriptionbooleanReturnstrueif the given message should be handled.protected ByteBufallocateBuffer(ChannelHandlerContext ctx, ByteBuf msg, boolean preferDirect) Allocate aByteBufwhich will be used as argument ofMessageToByteEncoder.encode(ChannelHandlerContext, I, ByteBuf).protected abstract voidencode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) Encode a message into aByteBuf.protected booleanvoidwrite(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) CallsChannelOutboundInvoker.write(Object, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.Methods inherited from class ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, readModifier and TypeMethodDescriptionvoidbind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) CallsChannelOutboundInvoker.bind(SocketAddress, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidclose(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.close(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidconnect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) CallsChannelOutboundInvoker.connect(SocketAddress, SocketAddress, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidderegister(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.deregister(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voiddisconnect(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.disconnect(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.flush()to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.read()to forward to the nextChannelOutboundHandlerin theChannelPipeline.Methods inherited from class ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableModifier and TypeMethodDescriptionprotected voidvoidexceptionCaught(ChannelHandlerContext ctx, Throwable cause) Deprecated.voidDo nothing by default, sub-classes may override this method.voidDo nothing by default, sub-classes may override this method.booleanReturntrueif the implementation isChannelHandler.Sharableand so can be added to differentChannelPipelines.
-
Constructor Details
-
ZlibEncoder
protected ZlibEncoder()
-
-
Method Details
-
isClosed
public abstract boolean isClosed()Returnstrueif and only if the end of the compressed stream has been reached. -
close
Close thisZlibEncoderand so finish the encoding. The returnedChannelFuturewill be notified once the operation completes. -
close
Close thisZlibEncoderand so finish the encoding. The givenChannelFuturewill be notified once the operation completes and will also be returned.
-
ChannelInboundHandler