Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Unknown
Description
In the ZipDataForamt class you find
final Deflater deflater = new Deflater(compressionLevel);
final DeflaterOutputStream zipOutput = new DeflaterOutputStream(stream, new Deflater(compressionLevel));
try
finally {
IOHelper.close(is, zipOutput);
/*
- As we create the Deflater our self and do not use the stream default
- (see
{@link java.util.zip.DeflaterOutputStream#usesDefaultDeflater}
)
- we need to close the Deflater to not risk a OutOfMemoryException
- in native code parts (see
{@link java.util.zip.Deflater#end}
)
*/
deflater.end();
}
the deflater variable should be used in the DeflaterOutputStream
final DeflaterOutputStream zipOutput = new DeflaterOutputStream(stream, deflater);