storing uncompressed zip files

I am using ZipOutputStream to create an archive of (among other things) image files. Since the images are already compressed, I would like to archive them in STORED (uncompressed) mode. But when I do so, I get the following exception from ZipOutputStream.putNextEntry():

STORED entry missing size, compressed size, or crc-32

The size is there; what it wants is the checksum value. If I archive the images in DEFLATED mode, I have no problem.

Do I really need to calculate the checksum value myself before archiving an uncompressed file?

[568 byte] By [glevnera] at [2007-10-1 14:22:21]
# 1

Did you try this?

public void setLevel(int level)

/*

Sets the compression level for subsequent entries which are DEFLATED.

The default setting is DEFAULT_COMPRESSION.

Parameters:

level - the compression level (0-9)

*/

BIJ001a at 2007-7-10 17:53:54 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 2
That has no effect, nor should it: the documentation says it only concerns DEFLATED (compressed) mode.
glevnera at 2007-7-10 17:53:54 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...