CSharp examples for File IO:GZip
Compress Data
using System;/* w w w.j a v a2s . c o m*/ using System.IO; using System.IO.Compression; class MainClass { static void Main(string[] args) { GZipStream zipout = new GZipStream(File.OpenWrite("compressed_data.gzip"),CompressionMode.Compress); StreamWriter writer = new StreamWriter(zipout); writer.WriteLine("the quick brown fox"); writer.Close(); GZipStream zipin = new GZipStream(File.OpenRead("compressed_data.gzip"),CompressionMode.Decompress); StreamReader reader = new StreamReader(zipin); Console.WriteLine(reader.ReadLine()); } }