@Override
    public HttpResponse execute(ClientRequestContext ctx, HttpRequest req) throws Exception {
        Map<String, StreamDecoderFactory> decoderFactories = this.decoderFactories;

        if (autoFillAcceptEncoding) {
            if (req.headers().contains(HttpHeaderNames.ACCEPT_ENCODING)) {
                // Client specified encoding, so we don't do anything automatically.
                return unwrap().execute(ctx, req);
            }

            req = updateAcceptEncoding(ctx, req, acceptEncodingHeader);
            return executeAndDecodeResponse(ctx, req, decoderFactories);
        }

        // Respect user-defined accept-encoding.
        final String acceptEncoding = req.headers().get(HttpHeaderNames.ACCEPT_ENCODING);
        if (Strings.isNullOrEmpty(acceptEncoding)) {
            // No accept-encoding is specified.
            return unwrap().execute(ctx, req);
        }

        final Set<String> encodings = ImmutableSet.copyOf(ENCODING_SPLITTER.split(acceptEncoding));
        final ImmutableMap.Builder<String, StreamDecoderFactory> factoryBuilder =
                ImmutableMap.builderWithExpectedSize(encodings.size());

        for (String encoding : encodings) {
            final StreamDecoderFactory factory = decoderFactories.get(encoding);
            if (factory != null) {
                factoryBuilder.put(factory.encodingHeaderValue(), factory);
            }
        }

        final Map<String, StreamDecoderFactory> availableFactories = factoryBuilder.build();
        if (availableFactories.isEmpty()) {
            // Unsupported encoding.
            req = updateAcceptEncoding(ctx, req, null);
            return unwrap().execute(ctx, req);
        }

        if (encodings.size() != availableFactories.size()) {
            // Use only supported encodings.
            final String acceptEncodingHeader = String.join(",", availableFactories.keySet());
            req = updateAcceptEncoding(ctx, req, acceptEncodingHeader);
        }
        decoderFactories = availableFactories;

        return executeAndDecodeResponse(ctx, req, decoderFactories);
    }
Creates a new instance that decorates the specified {@link HttpClient} with the provided decoders.
core/src/main/java/com/linecorp/armeria/client/encoding/DecodingClient.java