Class HttpContentEncoder

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HttpContentEncoder.Result  
      • Nested classes/interfaces inherited from interface io.netty5.channel.ChannelHandler

        io.netty5.channel.ChannelHandler.Sharable
    • Constructor Detail

      • HttpContentEncoder

        public HttpContentEncoder()
    • Method Detail

      • acceptOutboundMessage

        public boolean acceptOutboundMessage​(Object msg)
                                      throws Exception
        Overrides:
        acceptOutboundMessage in class io.netty5.handler.codec.MessageToMessageCodec<HttpRequest,​HttpObject>
        Throws:
        Exception
      • beginEncode

        protected abstract HttpContentEncoder.Result beginEncode​(HttpResponse httpResponse,
                                                                 String acceptEncoding)
                                                          throws Exception
        Prepare to encode the HTTP message content.
        Parameters:
        httpResponse - the http response
        acceptEncoding - the value of the "Accept-Encoding" header
        Returns:
        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).
        Throws:
        Exception
      • handlerRemoved

        public void handlerRemoved​(io.netty5.channel.ChannelHandlerContext ctx)
                            throws Exception
        Throws:
        Exception
      • channelInactive

        public void channelInactive​(io.netty5.channel.ChannelHandlerContext ctx)
                             throws Exception
        Throws:
        Exception