Bug /w Save (multiple saves.)

May 24, 2010 at 12:28 AM

Steps to reproduce: Create a Zipfile and add contents.
Save once to file.
Save again to memory stream. (Null Reference Exception.)

Try again, save to memory stream then save to file. (Cannot find file exception.)


using (ZipFile file = new ZipFile())
// Associate the Zip file with process.
    // ...  (Fill File) ...

    // Save to memory stream, then save to file.
    MemoryStream memoryStream = new MemoryStream(); 
    _Process.BinaryFileImage = memoryStream.GetBuffer();


Essentially I want to save a file, then also write the byte stream to a DB. Work-around is to save to the memory stream, then save the memory stream to file.

I've traced into the source and the issue appears when the library attempts to perform the Reset() call on the second save.

May 24, 2010 at 4:12 PM

Right, thanks.

I think there is a workitem for this already. http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=10735