Top Constructors Methods
io.vertx.core.http.impl

pack-priv final Class HttpChunkContentCompressor

extends HttpContentCompressor
Class Inheritance
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelHandlerContext, .ChannelPromise, io.netty.handler.codec.compression.CompressionOptions, .StandardCompressionOptions, io.netty.handler.codec.http.DefaultHttpContent, .HttpContentCompressor, .HttpHeaderNames, .HttpResponse

Author
Norman Maurer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected HttpContentEncoder.Result
beginEncode(HttpResponse
the http response
httpResponse
,
String
the value of the "Accept-Encoding" header
acceptEncoding
)

Overrides io.netty.handler.codec.http.HttpContentCompressor.beginEncode.

Prepare to encode the HTTP message content.

public void
write(ChannelHandlerContext
the ChannelHandlerContext for which the write operation is made
ctx
,
Object
the message to write
msg
,
ChannelPromise
the ChannelPromise to notify once the operation completes
promise
)

Overrides io.netty.handler.codec.MessageToMessageCodec.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.

Inherited from io.netty.handler.codec.http.HttpContentCompressor:
determineEncodingdetermineWrapperhandlerAdded

Constructor Detail

HttpChunkContentCompressorback to summary
public HttpChunkContentCompressor(CompressionOptions... compressionOptions)

Method Detail

beginEncodeback to summary
protected HttpContentEncoder.Result beginEncode(HttpResponse httpResponse, String acceptEncoding) throws Exception

Overrides io.netty.handler.codec.http.HttpContentCompressor.beginEncode.

Doc from io.netty.handler.codec.http.HttpContentEncoder.beginEncode.

Prepare to encode the HTTP message content.

Parameters
httpResponse:HttpResponse

the http response

acceptEncoding:String

the value of the "Accept-Encoding" header

Returns:HttpContentEncoder.Result

the result of preparation, which is composed of the determined target content encoding and a new EmbeddedChannel that encodes the content into the target content encoding. null if acceptEncoding is unsupported or rejected and thus the content should be handled as-is (i.e. no encoding).

Annotations
@Override
writeback to summary
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception

Overrides io.netty.handler.codec.MessageToMessageCodec.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Doc from io.netty.channel.ChannelDuplexHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Parameters
ctx:ChannelHandlerContext

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelHandlerContext for which the write operation is made

msg:Object

Doc from io.netty.channel.ChannelOutboundHandler.write.

the message to write

promise:ChannelPromise

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelPromise to notify once the operation completes

Annotations
@Override
Exceptions
Exception:

Doc from io.netty.channel.ChannelOutboundHandler.write.

thrown if an error occurs