RFR: 4452735: Add GZIPOutputStream constructor to specify Deflater
Jaikiran Pai
jpai at openjdk.org
Fri Jul 19 03:49:35 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`.
Hello Chen, yes this PR and another one from Archie in this area is on my list to review. I'll be getting to this one shortly.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20226#issuecomment-2238060585
More information about the core-libs-dev
mailing list