Zip creation done in Memory?

Jan 26, 2011 at 6:19 PM

Hello. Is all zipping done in memory? What happens if archive is large (2+ GB)? Is it going to take up all that ram until I save it?

Thanks.

Jan 27, 2011 at 8:49 PM

Well, I guess I didn't do my research. As I understand no compression is done until I do Save. I'm guessing a buffer is used at that point.

Coordinator
Jan 31, 2011 at 1:41 PM

DotNetZip uses a streaming design.  Data is read in from the source (a file, or a stream), chunkwise into a buffer, then compressed and or encrypted according to your desired options, then written to the output (a file, or a stream).  If you care, you can set the sizes of the buffer used to do IO and compression.  In most cases you don't need to worry about the buffer sizes. Check the documentation on the ZipFile class for more details.