Tuesday, July 10, 2012

c# - Decompressing a GZip file using GZipStream

using (FileStream fs = new FileStream(@"C:\Folder_Name\File_Name.gz", FileMode.Open))
{
    using (GZipStream gz = new GZipStream(fs, CompressionMode.Decompress))
    {
         using (StreamReader sr = new StreamReader(gz))
         {
                Console.WriteLine(sr.ReadToEnd());
         }
    }
}

No comments: