RFR: 4452735: Add GZIPOutputStream constructor to specify Deflater
Chen Liang
liach at openjdk.org
Thu Jul 18 22:52:31 UTC 2024
On Wed, 17 Jul 2024 21:07:23 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> The class `GZIPOutputStream` extends `DeflaterOutputStream`, which is logical because the GZIP encoding is based on ZLIB "deflate" encoding.
>
> However, while `DeflaterOutputStream` provides constructors that take a custom `Deflater` argument supplied by the caller, `GZIPOutputStream` has no such constructors.
>
> As a result, it's not possible to do entirely reasonable customization, such as configuring a `GZIPOutputStream` for a non-default compression level.
>
> This change adds a new `GZIPOutputStream` constructor that accepts a custom `Deflater`, and also adds a basic unit test for it and all of the other `GZIPOutputStream` constructors, based on the existing test `BasicGZIPInputStreamTest.java` which does the same thing for `GZIPInputStream`.
@jaikiran Is it possible for you to review this, as you are familiar with this area?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20226#issuecomment-2237745878
More information about the core-libs-dev
mailing list