On Wed, 22 Mar 2023 23:45:43 GMT, jmehrens <d...@openjdk.org> wrote:

> The example code works without setting the compressed size on the entry?

Yes, this is the minimal code required and is also how the `jar` tool does it. 

The current behaviour does feel a bit underspecified though.  In the `ZipEntry` 
and `ZipOutputStream` documentation, `getCompressedSize` documents that: 'In 
the case of a stored entry, the compressed size will be the same as the 
uncompressed size of the entry.'

Perhaps a similar note should be addded to `ZipEntry.setCompressedSize`, 
documenting that this method need not be called for STORED entries.

@LanceAndersen what do you think?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/12899#issuecomment-1480705313

Reply via email to