View Single Post
Old 27-09-2007, 01:12 AM   #2
Jon Skeet [C# MVP]
Guest
 
Posts: n/a
Re: Zip file using a stream

Chris Fink <ChrisFink@discussions.microsoft.com> wrote:
> I am trying to make a minor modification to the code below and need some
> assistance. Currently this code is using the java.util, java.util.zip, and
> java.io assemblies from the vjslib.dll assembly. This code works fine by
> taking file(s) from
> disk and creating a zip file to disk. I need to modify this code to read a
> file from a byte array and then output the zip file to a byte array (all done
> in memory instead of disk). The reason for the byte array is that all the
> files are being stored in the database in a BLOB field. Any assistance is
> appreciated!


Use a MemoryOutputStream instead of a FileOutputStream. You can do this
without using the Java classes at all using #ZipLib (google SharpZipLib
for details) and MemoryStream.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
  Reply With Quote