Zip data in files

This morning, I was trying to create a Custom Persistence Service in order to store  a workflow activity in a file; I found the following code in the WWF sdk  :
 
fileStream = new FileStream(filename, FileMode.CreateNew, FileAccess.Write, FileShare.None);
   
                // get the compressed serialized form
                using (GZipStream gzs = new GZipStream(fileStream, CompressionMode.Compress, true))
                {
                    myActivity.Save(gzs);
                }
 
A very handy way to zip data in a file, indeed…
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s