Class HttpContentEncoder

    • 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
      • decodeAndClose

        protected void decodeAndClose​(io.netty5.channel.ChannelHandlerContext ctx,
                                      HttpRequest msg)
                               throws Exception
        Overrides:
        decodeAndClose 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