From ce73ba58d8c6c733fdc060d89ac6d229a55fdd28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
Date: Thu, 30 Mar 2023 13:19:04 +0200
Subject: [PATCH 4/7] Disable Brotli and ZStd compression

---
 .../codec/http/HttpContentCompressor.java     | 105 +-----------------
 .../codec/http/HttpContentDecompressor.java   |  22 ----
 .../CompressorHttp2ConnectionEncoder.java     |  42 +------
 .../DelegatingDecompressorFrameListener.java  |  20 ----
 .../StandardCompressionOptions.java           |  53 +--------
 5 files changed, 5 insertions(+), 237 deletions(-)

diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java
index 0effd37779..51e6c10934 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java
@@ -22,9 +22,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.embedded.EmbeddedChannel;
 import io.netty.handler.codec.MessageToByteEncoder;
-import io.netty.handler.codec.compression.Brotli;
-import io.netty.handler.codec.compression.BrotliEncoder;
-import io.netty.handler.codec.compression.BrotliOptions;
 import io.netty.handler.codec.compression.CompressionOptions;
 import io.netty.handler.codec.compression.DeflateOptions;
 import io.netty.handler.codec.compression.GzipOptions;
@@ -32,11 +29,6 @@ import io.netty.handler.codec.compression.StandardCompressionOptions;
 import io.netty.handler.codec.compression.ZlibCodecFactory;
 import io.netty.handler.codec.compression.ZlibEncoder;
 import io.netty.handler.codec.compression.ZlibWrapper;
-import io.netty.handler.codec.compression.Zstd;
-import io.netty.handler.codec.compression.ZstdEncoder;
-import io.netty.handler.codec.compression.ZstdOptions;
-import io.netty.handler.codec.compression.SnappyFrameEncoder;
-import io.netty.handler.codec.compression.SnappyOptions;
 import io.netty.util.internal.ObjectUtil;
 
 /**
@@ -49,11 +41,8 @@ import io.netty.util.internal.ObjectUtil;
 public class HttpContentCompressor extends HttpContentEncoder {
 
     private final boolean supportsCompressionOptions;
-    private final BrotliOptions brotliOptions;
     private final GzipOptions gzipOptions;
     private final DeflateOptions deflateOptions;
-    private final ZstdOptions zstdOptions;
-    private final SnappyOptions snappyOptions;
 
     private final int compressionLevel;
     private final int windowBits;
@@ -137,11 +126,8 @@ public class HttpContentCompressor extends HttpContentEncoder {
         this.windowBits = ObjectUtil.checkInRange(windowBits, 9, 15, "windowBits");
         this.memLevel = ObjectUtil.checkInRange(memLevel, 1, 9, "memLevel");
         this.contentSizeThreshold = ObjectUtil.checkPositiveOrZero(contentSizeThreshold, "contentSizeThreshold");
-        this.brotliOptions = null;
         this.gzipOptions = null;
         this.deflateOptions = null;
-        this.zstdOptions = null;
-        this.snappyOptions = null;
         this.factories = null;
         this.supportsCompressionOptions = false;
     }
@@ -170,17 +156,11 @@ public class HttpContentCompressor extends HttpContentEncoder {
      */
     public HttpContentCompressor(int contentSizeThreshold, CompressionOptions... compressionOptions) {
         this.contentSizeThreshold = ObjectUtil.checkPositiveOrZero(contentSizeThreshold, "contentSizeThreshold");
-        BrotliOptions brotliOptions = null;
         GzipOptions gzipOptions = null;
         DeflateOptions deflateOptions = null;
-        ZstdOptions zstdOptions = null;
-        SnappyOptions snappyOptions = null;
         if (compressionOptions == null || compressionOptions.length == 0) {
-            brotliOptions = Brotli.isAvailable() ? StandardCompressionOptions.brotli() : null;
             gzipOptions = StandardCompressionOptions.gzip();
             deflateOptions = StandardCompressionOptions.deflate();
-            zstdOptions = Zstd.isAvailable() ? StandardCompressionOptions.zstd() : null;
-            snappyOptions = StandardCompressionOptions.snappy();
         } else {
             ObjectUtil.deepCheckNotNull("compressionOptions", compressionOptions);
             for (CompressionOptions compressionOption : compressionOptions) {
@@ -190,16 +170,10 @@ public class HttpContentCompressor extends HttpContentEncoder {
                 // This results in the static analysis of native-image identifying the instanceof BrotliOptions check
                 // and thus BrotliOptions itself as unreachable, enabling native-image to link all classes
                 // at build time and not complain about the missing Brotli classes.
-                if (Brotli.isAvailable() && compressionOption instanceof BrotliOptions) {
-                    brotliOptions = (BrotliOptions) compressionOption;
-                } else if (compressionOption instanceof GzipOptions) {
+                if (compressionOption instanceof GzipOptions) {
                     gzipOptions = (GzipOptions) compressionOption;
                 } else if (compressionOption instanceof DeflateOptions) {
                     deflateOptions = (DeflateOptions) compressionOption;
-                } else if (compressionOption instanceof ZstdOptions) {
-                    zstdOptions = (ZstdOptions) compressionOption;
-                } else if (compressionOption instanceof SnappyOptions) {
-                    snappyOptions = (SnappyOptions) compressionOption;
                 } else {
                     throw new IllegalArgumentException("Unsupported " + CompressionOptions.class.getSimpleName() +
                             ": " + compressionOption);
@@ -209,9 +183,6 @@ public class HttpContentCompressor extends HttpContentEncoder {
 
         this.gzipOptions = gzipOptions;
         this.deflateOptions = deflateOptions;
-        this.brotliOptions = brotliOptions;
-        this.zstdOptions = zstdOptions;
-        this.snappyOptions = snappyOptions;
 
         this.factories = new HashMap<String, CompressionEncoderFactory>();
 
@@ -221,15 +192,6 @@ public class HttpContentCompressor extends HttpContentEncoder {
         if (this.deflateOptions != null) {
             this.factories.put("deflate", new DeflateEncoderFactory());
         }
-        if (Brotli.isAvailable() && this.brotliOptions != null) {
-            this.factories.put("br", new BrEncoderFactory());
-        }
-        if (this.zstdOptions != null) {
-            this.factories.put("zstd", new ZstdEncoderFactory());
-        }
-        if (this.snappyOptions != null) {
-            this.factories.put("snappy", new SnappyEncoderFactory());
-        }
 
         this.compressionLevel = -1;
         this.windowBits = -1;
@@ -302,9 +264,6 @@ public class HttpContentCompressor extends HttpContentEncoder {
     @SuppressWarnings("FloatingPointEquality")
     protected String determineEncoding(String acceptEncoding) {
         float starQ = -1.0f;
-        float brQ = -1.0f;
-        float zstdQ = -1.0f;
-        float snappyQ = -1.0f;
         float gzipQ = -1.0f;
         float deflateQ = -1.0f;
         for (String encoding : acceptEncoding.split(",")) {
@@ -320,41 +279,20 @@ public class HttpContentCompressor extends HttpContentEncoder {
             }
             if (encoding.contains("*")) {
                 starQ = q;
-            } else if (encoding.contains("br") && q > brQ) {
-                brQ = q;
-            } else if (encoding.contains("zstd") && q > zstdQ) {
-                zstdQ = q;
-            } else if (encoding.contains("snappy") && q > snappyQ) {
-                snappyQ = q;
             } else if (encoding.contains("gzip") && q > gzipQ) {
                 gzipQ = q;
             } else if (encoding.contains("deflate") && q > deflateQ) {
                 deflateQ = q;
             }
         }
-        if (brQ > 0.0f || zstdQ > 0.0f || snappyQ > 0.0f || gzipQ > 0.0f || deflateQ > 0.0f) {
-            if (brQ != -1.0f && brQ >= zstdQ && this.brotliOptions != null) {
-                return "br";
-            } else if (zstdQ != -1.0f && zstdQ >= snappyQ && this.zstdOptions != null) {
-                return "zstd";
-            } else if (snappyQ != -1.0f && snappyQ >= gzipQ && this.snappyOptions != null) {
-                return "snappy";
-            } else if (gzipQ != -1.0f && gzipQ >= deflateQ && this.gzipOptions != null) {
+        if (gzipQ > 0.0f || deflateQ > 0.0f) {
+            if (gzipQ != -1.0f && gzipQ >= deflateQ && this.gzipOptions != null) {
                 return "gzip";
             } else if (deflateQ != -1.0f && this.deflateOptions != null) {
                 return "deflate";
             }
         }
         if (starQ > 0.0f) {
-            if (brQ == -1.0f && this.brotliOptions != null) {
-                return "br";
-            }
-            if (zstdQ == -1.0f && this.zstdOptions != null) {
-                return "zstd";
-            }
-            if (snappyQ == -1.0f && this.snappyOptions != null) {
-                return "snappy";
-            }
             if (gzipQ == -1.0f && this.gzipOptions != null) {
                 return "gzip";
             }
@@ -435,41 +373,4 @@ public class HttpContentCompressor extends HttpContentEncoder {
                     deflateOptions.windowBits(), deflateOptions.memLevel());
         }
     }
-
-    /**
-     * Compression Encoder Factory that creates {@link BrotliEncoder}s
-     * used to compress http content for br content encoding
-     */
-    private final class BrEncoderFactory implements CompressionEncoderFactory {
-
-        @Override
-        public MessageToByteEncoder<ByteBuf> createEncoder() {
-            return new BrotliEncoder(brotliOptions.parameters());
-        }
-    }
-
-    /**
-     * Compression Encoder Factory for create {@link ZstdEncoder}
-     * used to compress http content for zstd content encoding
-     */
-    private final class ZstdEncoderFactory implements CompressionEncoderFactory {
-
-        @Override
-        public MessageToByteEncoder<ByteBuf> createEncoder() {
-            return new ZstdEncoder(zstdOptions.compressionLevel(),
-                    zstdOptions.blockSize(), zstdOptions.maxEncodeSize());
-        }
-    }
-
-    /**
-     * Compression Encoder Factory for create {@link SnappyFrameEncoder}
-     * used to compress http content for snappy content encoding
-     */
-    private static final class SnappyEncoderFactory implements CompressionEncoderFactory {
-
-        @Override
-        public MessageToByteEncoder<ByteBuf> createEncoder() {
-            return new SnappyFrameEncoder();
-        }
-    }
 }
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentDecompressor.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentDecompressor.java
index 3b1134b038..c2f3150bfd 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentDecompressor.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentDecompressor.java
@@ -15,22 +15,14 @@
  */
 package io.netty.handler.codec.http;
 
-import static io.netty.handler.codec.http.HttpHeaderValues.BR;
 import static io.netty.handler.codec.http.HttpHeaderValues.DEFLATE;
 import static io.netty.handler.codec.http.HttpHeaderValues.GZIP;
 import static io.netty.handler.codec.http.HttpHeaderValues.X_DEFLATE;
 import static io.netty.handler.codec.http.HttpHeaderValues.X_GZIP;
-import static io.netty.handler.codec.http.HttpHeaderValues.SNAPPY;
-import static io.netty.handler.codec.http.HttpHeaderValues.ZSTD;
 
 import io.netty.channel.embedded.EmbeddedChannel;
-import io.netty.handler.codec.compression.Brotli;
-import io.netty.handler.codec.compression.BrotliDecoder;
-import io.netty.handler.codec.compression.SnappyFrameDecoder;
 import io.netty.handler.codec.compression.ZlibCodecFactory;
 import io.netty.handler.codec.compression.ZlibWrapper;
-import io.netty.handler.codec.compression.Zstd;
-import io.netty.handler.codec.compression.ZstdDecoder;
 
 /**
  * Decompresses an {@link HttpMessage} and an {@link HttpContent} compressed in
@@ -72,20 +64,6 @@ public class HttpContentDecompressor extends HttpContentDecoder {
             return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
                     ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(wrapper));
         }
-        if (Brotli.isAvailable() && BR.contentEqualsIgnoreCase(contentEncoding)) {
-            return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
-              ctx.channel().config(), new BrotliDecoder());
-        }
-
-        if (SNAPPY.contentEqualsIgnoreCase(contentEncoding)) {
-            return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
-                    ctx.channel().config(), new SnappyFrameDecoder());
-        }
-
-        if (Zstd.isAvailable() && ZSTD.contentEqualsIgnoreCase(contentEncoding)) {
-            return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
-                    ctx.channel().config(), new ZstdDecoder());
-        }
 
         // 'identity' or unsupported
         return null;
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java
index b12213dff6..fdeadaebbe 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java
@@ -21,20 +21,12 @@ import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelPromise;
 import io.netty.channel.embedded.EmbeddedChannel;
 import io.netty.handler.codec.ByteToMessageDecoder;
-import io.netty.handler.codec.compression.BrotliEncoder;
 import io.netty.handler.codec.compression.ZlibCodecFactory;
 import io.netty.handler.codec.compression.ZlibWrapper;
-import io.netty.handler.codec.compression.Brotli;
-import io.netty.handler.codec.compression.BrotliOptions;
 import io.netty.handler.codec.compression.CompressionOptions;
 import io.netty.handler.codec.compression.DeflateOptions;
 import io.netty.handler.codec.compression.GzipOptions;
 import io.netty.handler.codec.compression.StandardCompressionOptions;
-import io.netty.handler.codec.compression.Zstd;
-import io.netty.handler.codec.compression.ZstdEncoder;
-import io.netty.handler.codec.compression.ZstdOptions;
-import io.netty.handler.codec.compression.SnappyFrameEncoder;
-import io.netty.handler.codec.compression.SnappyOptions;
 import io.netty.util.concurrent.PromiseCombiner;
 import io.netty.util.internal.ObjectUtil;
 
@@ -43,14 +35,11 @@ import java.util.List;
 
 import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_ENCODING;
 import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH;
-import static io.netty.handler.codec.http.HttpHeaderValues.BR;
 import static io.netty.handler.codec.http.HttpHeaderValues.DEFLATE;
 import static io.netty.handler.codec.http.HttpHeaderValues.GZIP;
 import static io.netty.handler.codec.http.HttpHeaderValues.IDENTITY;
 import static io.netty.handler.codec.http.HttpHeaderValues.X_DEFLATE;
 import static io.netty.handler.codec.http.HttpHeaderValues.X_GZIP;
-import static io.netty.handler.codec.http.HttpHeaderValues.ZSTD;
-import static io.netty.handler.codec.http.HttpHeaderValues.SNAPPY;
 
 /**
  * A decorating HTTP2 encoder that will compress data frames according to the {@code content-encoding} header for each
@@ -69,11 +58,8 @@ public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionE
 
     private final boolean supportsCompressionOptions;
 
-    private BrotliOptions brotliOptions;
     private GzipOptions gzipCompressionOptions;
     private DeflateOptions deflateOptions;
-    private ZstdOptions zstdOptions;
-    private SnappyOptions snappyOptions;
 
     /**
      * Create a new {@link CompressorHttp2ConnectionEncoder} instance
@@ -87,13 +73,6 @@ public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionE
         List<CompressionOptions> compressionOptions = new ArrayList<CompressionOptions>();
         compressionOptions.add(StandardCompressionOptions.gzip());
         compressionOptions.add(StandardCompressionOptions.deflate());
-        compressionOptions.add(StandardCompressionOptions.snappy());
-        if (Brotli.isAvailable()) {
-            compressionOptions.add(StandardCompressionOptions.brotli());
-        }
-        if (Zstd.isAvailable()) {
-            compressionOptions.add(StandardCompressionOptions.zstd());
-        }
         return compressionOptions.toArray(new CompressionOptions[0]);
     }
 
@@ -139,16 +118,10 @@ public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionE
             // This results in the static analysis of native-image identifying the instanceof BrotliOptions check
             // and thus BrotliOptions itself as unreachable, enabling native-image to link all classes at build time
             // and not complain about the missing Brotli classes.
-            if (Brotli.isAvailable() && compressionOptions instanceof BrotliOptions) {
-                brotliOptions = (BrotliOptions) compressionOptions;
-            } else if (compressionOptions instanceof GzipOptions) {
+            if (compressionOptions instanceof GzipOptions) {
                 gzipCompressionOptions = (GzipOptions) compressionOptions;
             } else if (compressionOptions instanceof DeflateOptions) {
                 deflateOptions = (DeflateOptions) compressionOptions;
-            } else if (compressionOptions instanceof ZstdOptions) {
-                zstdOptions = (ZstdOptions) compressionOptions;
-            } else if (compressionOptions instanceof SnappyOptions) {
-                snappyOptions = (SnappyOptions) compressionOptions;
             } else {
                 throw new IllegalArgumentException("Unsupported " + CompressionOptions.class.getSimpleName() +
                         ": " + compressionOptions);
@@ -286,19 +259,6 @@ public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionE
         if (DEFLATE.contentEqualsIgnoreCase(contentEncoding) || X_DEFLATE.contentEqualsIgnoreCase(contentEncoding)) {
             return newCompressionChannel(ctx, ZlibWrapper.ZLIB);
         }
-        if (Brotli.isAvailable() && brotliOptions != null && BR.contentEqualsIgnoreCase(contentEncoding)) {
-            return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
-                    ctx.channel().config(), new BrotliEncoder(brotliOptions.parameters()));
-        }
-        if (zstdOptions != null && ZSTD.contentEqualsIgnoreCase(contentEncoding)) {
-            return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
-                    ctx.channel().config(), new ZstdEncoder(zstdOptions.compressionLevel(),
-                    zstdOptions.blockSize(), zstdOptions.maxEncodeSize()));
-        }
-        if (snappyOptions != null && SNAPPY.contentEqualsIgnoreCase(contentEncoding)) {
-            return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
-                    ctx.channel().config(), new SnappyFrameEncoder());
-        }
         // 'identity' or unsupported
         return null;
     }
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java
index 88245d1116..de44d6013b 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java
@@ -19,24 +19,16 @@ import io.netty.buffer.Unpooled;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.embedded.EmbeddedChannel;
 import io.netty.handler.codec.ByteToMessageDecoder;
-import io.netty.handler.codec.compression.Brotli;
-import io.netty.handler.codec.compression.BrotliDecoder;
-import io.netty.handler.codec.compression.Zstd;
-import io.netty.handler.codec.compression.ZstdDecoder;
 import io.netty.handler.codec.compression.ZlibCodecFactory;
 import io.netty.handler.codec.compression.ZlibWrapper;
-import io.netty.handler.codec.compression.SnappyFrameDecoder;
 
 import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_ENCODING;
 import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH;
-import static io.netty.handler.codec.http.HttpHeaderValues.BR;
 import static io.netty.handler.codec.http.HttpHeaderValues.DEFLATE;
 import static io.netty.handler.codec.http.HttpHeaderValues.GZIP;
 import static io.netty.handler.codec.http.HttpHeaderValues.IDENTITY;
 import static io.netty.handler.codec.http.HttpHeaderValues.X_DEFLATE;
 import static io.netty.handler.codec.http.HttpHeaderValues.X_GZIP;
-import static io.netty.handler.codec.http.HttpHeaderValues.SNAPPY;
-import static io.netty.handler.codec.http.HttpHeaderValues.ZSTD;
 import static io.netty.handler.codec.http2.Http2Error.INTERNAL_ERROR;
 import static io.netty.handler.codec.http2.Http2Exception.streamError;
 import static io.netty.util.internal.ObjectUtil.checkNotNull;
@@ -181,18 +173,6 @@ public class DelegatingDecompressorFrameListener extends Http2FrameListenerDecor
             return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
                     ctx.channel().config(), ZlibCodecFactory.newZlibDecoder(wrapper));
         }
-        if (Brotli.isAvailable() && BR.contentEqualsIgnoreCase(contentEncoding)) {
-            return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
-              ctx.channel().config(), new BrotliDecoder());
-        }
-        if (SNAPPY.contentEqualsIgnoreCase(contentEncoding)) {
-            return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
-                    ctx.channel().config(), new SnappyFrameDecoder());
-        }
-        if (Zstd.isAvailable() && ZSTD.contentEqualsIgnoreCase(contentEncoding)) {
-            return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
-                    ctx.channel().config(), new ZstdDecoder());
-        }
         // 'identity' or unsupported
         return null;
     }
diff --git a/codec/src/main/java/io/netty/handler/codec/compression/StandardCompressionOptions.java b/codec/src/main/java/io/netty/handler/codec/compression/StandardCompressionOptions.java
index ac2582418c..698c4b510a 100644
--- a/codec/src/main/java/io/netty/handler/codec/compression/StandardCompressionOptions.java
+++ b/codec/src/main/java/io/netty/handler/codec/compression/StandardCompressionOptions.java
@@ -15,10 +15,8 @@
  */
 package io.netty.handler.codec.compression;
 
-import com.aayushatharva.brotli4j.encoder.Encoder;
-
 /**
- * Standard Compression Options for {@link BrotliOptions},
+ * Standard Compression Options for
  * {@link GzipOptions} and {@link DeflateOptions}
  */
 public final class StandardCompressionOptions {
@@ -28,55 +26,6 @@ public final class StandardCompressionOptions {
     }
 
     /**
-     * Default implementation of {@link BrotliOptions} with {@link Encoder.Parameters#setQuality(int)} set to 4
-     * and {@link Encoder.Parameters#setMode(Encoder.Mode)} set to {@link Encoder.Mode#TEXT}
-     */
-    public static BrotliOptions brotli() {
-        return BrotliOptions.DEFAULT;
-    }
-
-    /**
-     * Create a new {@link BrotliOptions}
-     *
-     * @param parameters {@link Encoder.Parameters} Instance
-     * @throws NullPointerException If {@link Encoder.Parameters} is {@code null}
-     */
-    public static BrotliOptions brotli(Encoder.Parameters parameters) {
-        return new BrotliOptions(parameters);
-    }
-
-    /**
-     * Default implementation of {@link ZstdOptions} with{compressionLevel(int)} set to
-     * {@link ZstdConstants#DEFAULT_COMPRESSION_LEVEL},{@link ZstdConstants#DEFAULT_BLOCK_SIZE},
-     * {@link ZstdConstants#MAX_BLOCK_SIZE}
-     */
-    public static ZstdOptions zstd() {
-        return ZstdOptions.DEFAULT;
-    }
-
-    /**
-     * Create a new {@link ZstdOptions}
-     *
-     * @param  blockSize
-     *           is used to calculate the compressionLevel
-     * @param  maxEncodeSize
-     *           specifies the size of the largest compressed object
-     * @param  compressionLevel
-     *           specifies the level of the compression
-     */
-    public static ZstdOptions zstd(int compressionLevel, int blockSize, int maxEncodeSize) {
-        return new ZstdOptions(compressionLevel, blockSize, maxEncodeSize);
-    }
-
-    /**
-     * Create a new {@link SnappyOptions}
-     *
-     */
-    public static SnappyOptions snappy() {
-        return new SnappyOptions();
-    }
-
-     /**
      * Default implementation of {@link GzipOptions} with
      * {@code compressionLevel()} set to 6, {@code windowBits()} set to 15 and {@code memLevel()} set to 8.
      */
-- 
2.46.1

