-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Clarification on default JdkZlibEncoder compression level #15212
Copy link
Copy link
Closed
Description
In JdkZlibEncoder, the javadoc specifies:
* @param compressionLevel
* {@code 1} yields the fastest compression and {@code 9} yields the
* best compression. {@code 0} means no compression. The default
* compression level is {@code 6}.Now this is true in case the overload with no compression level is used:
/**
* Creates a new zlib encoder with the default compression level ({@code 6})
* and the specified wrapper.
*
* @throws CompressionException if failed to initialize zlib
*/
public JdkZlibEncoder(ZlibWrapper wrapper) {
this(wrapper, 6);
}But if you look into the java.util.zip.Deflater that gets created in the constructor, it actually specifies:
/**
* Default compression level.
*/
public static final int DEFAULT_COMPRESSION = -1;Is there any reason why the netty default compression level deviates from the underlying Deflater default compression level?
Reactions are currently unavailable