MehwishRaza / winzipaes

Automatically exported from code.google.com/p/winzipaes
0 stars 0 forks source link

Avoid Out of Memory on #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using this library on mobile and with big files, I'm facing a problem of 
"OutOfMemory". I look in the code and you load the file in memory 

I try something in order to manage a low memory usage but I think I haven't do 
it well because I don't get my data after...

Could you give me a clue about how managing this ?

I want to encrypt and write in EncryptEntry while reading the originaly 
inputStream.

Is this good ?

Original issue reported on code.google.com by jean.fra...@gmail.com on 24 Nov 2010 at 4:40

GoogleCodeExporter commented 9 years ago
Unfortunately, all of today's add() variants depend on the "load the file in 
memory" to employ the standard java DeflaterOutputStream.

Please have a look at the comment to the addAll() method. There it says: "While 
the add(File, String) method does not need an additional zip file, this method
comes in handy, when your input data is larger then your available memory."
The "trick" with the addAll() method is, that it requires you to take care of 
the zipping (normally tmp-file based) and provide already zipped input, so the 
winzipaes lib only has to do the encryption - which can be done streambased.

Original comment by olaf.merkert on 28 Nov 2010 at 1:05