RFR: 8303923: ZipOutStream::putEntry should include an apiNote to indicate that the STORED compression method should be used when writing directory entries [v3]
jmehrens
duke at openjdk.org
Wed Mar 22 23:48:41 UTC 2023
On Sun, 19 Mar 2023 14:50:41 GMT, Eirik Bjorsnos <duke at openjdk.org> wrote:
>> ZipOutputStream currently writes directory entries using the DEFLATED compression method. This does not strictly comply with the APPNOTE.TXT specification and is also about 10x slower than using the STORED compression method.
>>
>> Because of these concerns, `ZipOutputStream.putNextEntry` should be updated with an `@apiNote` recommending
>> the use of the STORED compression method for directory entries.
>>
>> Suggested CSR in the first comment.
>
> Eirik Bjorsnos has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove speculation that using DEFLATED for directory entries is not in strict compliance with APPNOTE.txt
The example code works without setting the compressed size on the entry?
Looks like there is a check in ZipOutputStream::putNextEntry at
https://github.com/openjdk/jdk/blob/6cc4bb1169f34bc091cad3e2deec37cd5585e8d5/src/java.base/share/classes/java/util/zip/ZipOutputStream.java#L233
-------------
PR Comment: https://git.openjdk.org/jdk/pull/12899#issuecomment-1480394938
More information about the core-libs-dev
mailing list