RFR: 8066583: DeflaterInput/OutputStream and InflaterInput/OutputStream should explain responsibility for freeing resources [v6]
Jaikiran Pai
jpai at openjdk.org
Tue Apr 1 07:25:23 UTC 2025
On Tue, 1 Apr 2025 00:29:47 GMT, Chen Liang <liach at openjdk.org> wrote:
>> src/java.base/share/classes/java/util/zip/InflaterOutputStream.java line 89:
>>
>>> 87: * @apiNote
>>> 88: * The default decompressor will be closed when this output stream
>>> 89: * is {@linkplain #close() closed}.
>>
>> This can be normative, meaning you can drop the apiNote.
>
> Does the original specification imply a default decompressor is created, or is such a default decompressor simply used?
Hello Chen, if you mean whether multiple instances of these streams can share the same default decompressor, then no, they can't (and they don't). Each creates its own instance of default decompressor/compressor.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23655#discussion_r2022293348
More information about the core-libs-dev
mailing list