GZipInputStream Class

IC Sharp Sharp Zip Lib

ICSharpCode SharpZipLib Class Library

GZipInputStream Class

This filter stream is used to decompress a "GZIP" format stream. The "GZIP" format is described baseInputStream RFC 1952. author of the original java version : John Leuner

For a list of all members of this type, see GZipInputStream Members.

System.Object    System.MarshalByRefObject
      System.IO.Stream
         ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream
            ICSharpCode.SharpZipLib.GZip.GZipInputStream

public class GZipInputStream : InflaterInputStream

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Example

This sample shows how to unzip a gzipped file

using System;
using System.IO;

using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.GZip;

class MainClass
{
    public static void Main(string[] args)
    {
        using (Stream inStream = new GZipInputStream(File.OpenRead(args[0])))
        using (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) {
            byte[] buffer = new byte[4096];
            StreamUtils.Copy(inStream, outStream, buffer);
        }
    }
}    

Requirements

Namespace: ICSharpCode.SharpZipLib.GZip

Assembly: ICSharpCode.SharpZipLib (in ICSharpCode.SharpZipLib.dll)

See Also

GZipInputStream Members | ICSharpCode.SharpZipLib.GZip Namespace