This project is read-only.

Problem writing directly from stream

Mar 12, 2011 at 8:54 AM

I'm trying to write a stream directly from memory to a zip, but all of my files come out as 0-byte files in the resulting zip.


                using (ZipFile package = new ZipFile(fullpath))
                using (MemoryStream stream = new MemoryStream())
                using (BinaryWriter bin = new BinaryWriter(stream))


                    if (package.ContainsEntry("index"))
                        package.UpdateEntry("index", stream);
                        package.AddEntry("index", stream);



Anyone know what I'm doing wrong here?


Mar 13, 2011 at 12:18 AM

Nevermind, I figured it out. I just needed to rewind the stream before trying to save it.