[
https://issues.apache.org/jira/browse/COMPRESS-597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Anupama Shinde updated COMPRESS-597:
------------------------------------
Description:
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);
}
}
was:
I am using ZipArchiveOutputStream to download the file.
causing java.lang.OutOfMemoryError: Java heap space when downloading more that
2gb file
> 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
> Reporter: Anupama Shinde
> Priority: Major
>
> 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)