private static Function<? super HttpClient, ContentPreviewingClient> decodingContentPreviewDecorator() {
        final BiPredicate<? super RequestContext, ? super HttpHeaders> previewerPredicate =
                (requestContext, headers) -> {
                    final String contentEncoding = headers.get(HttpHeaderNames.CONTENT_ENCODING);
                    return "br".equals(contentEncoding) || "gzip".equals(contentEncoding);
                };
        final BiFunction<HttpHeaders, ByteBuf, String> producer = (headers, data) -> {
            final String contentEncoding = headers.get(HttpHeaderNames.CONTENT_ENCODING);
            final byte[] bytes = new byte[data.readableBytes()];
            data.getBytes(0, bytes);
            final byte[] decoded;
            final InputStream in = new ByteArrayInputStream(bytes);
            try (InputStream unzipper = "br".equals(contentEncoding) ? new BrotliInputStream(in)
                                                                     : new GZIPInputStream(in)) {
                decoded = ByteStreams.toByteArray(unzipper);
            } catch (Exception e) {
                throw new IllegalArgumentException(e);
            }
            return new String(decoded, StandardCharsets.UTF_8);
        };

        final ContentPreviewerFactory factory =
                ContentPreviewerFactory.builder()
                                       .maxLength(100)
                                       .binary(producer, previewerPredicate)
                                       .build();

        return ContentPreviewingClient.newDecorator(factory);
    }
Unlike {@link #decodedContentPreview()}, the content preview of this test is encoded data because
the previewing decorator is inserted before {@link DecodingClient}.
core/src/test/java/com/linecorp/armeria/client/logging/ContentPreviewingClientTest.java