[
https://issues.apache.org/jira/browse/COMPRESS-597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17445936#comment-17445936
]
Michael Osipov commented on COMPRESS-597:
-----------------------------------------
[~jochen], I think there is no bug here in Compress. Better to post a download
question on SO. [~anupamamanish.s], before you can decompress you should
download or stream on the fly.
Unless you provide proper information we'll need to close this ticket.
> causing java.lang.OutOfMemoryError: Java heap space when downloading more
> that 2gb file
> ---------------------------------------------------------------------------------------
>
> Key: COMPRESS-597
> URL: https://issues.apache.org/jira/browse/COMPRESS-597
> Project: Commons Compress
> Issue Type: Bug
> Components: Compressors
> Reporter: Anupama Shinde
> Priority: Critical
>
> I am using ZipArchiveOutputStream to download the file.
> causing java.lang.OutOfMemoryError: Java heap space when downloading more
> that 2gb file
>
>
> protected byte[] BUFFER = new byte[8 * 1024];
> void writeToZipOutputStream(InputStream is, ZipArchiveOutputStream zos)
> throws Exception, IOException
> {
> int i = 0;
> try
> {
> while ((i = is.read(BUFFER)) != -1)
> {
> zos.write(BUFFER, 0, i);
> }
> zos.flush();
> zos.closeArchiveEntry();
> }
> finally
> {
> IOUtils.closeQuietly(is);
> }
> }
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)