Class GZip
An example class to demonstrate compression and decompression of GZip streams.
Inheritance
System.Object
GZip
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ICSharpCode.SharpZipLib.GZip
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public static class GZip
Methods
| Improve this Doc View SourceCompress(Stream, Stream, Boolean, Int32, Int32)
Compress the inStream
sending
result data to outStream
Declaration
public static void Compress(Stream inStream, Stream outStream, bool isStreamOwner, int bufferSize = 512, int level = 6)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | inStream | The readable stream to compress. |
System.IO.Stream | outStream | The output stream to receive the compressed data. |
System.Boolean | isStreamOwner | Both streams are closed on completion if true. |
System.Int32 | bufferSize | Deflate buffer size, minimum 512 |
System.Int32 | level | Deflate compression level, 0-9 |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Input or output stream is null |
System.ArgumentOutOfRangeException | Buffer Size is smaller than 512 |
System.ArgumentOutOfRangeException | Compression level outside 0-9 |
Decompress(Stream, Stream, Boolean)
Decompress the inStream
writing
uncompressed data to the outStream
Declaration
public static void Decompress(Stream inStream, Stream outStream, bool isStreamOwner)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | inStream | The readable stream containing data to decompress. |
System.IO.Stream | outStream | The output stream to receive the decompressed data. |
System.Boolean | isStreamOwner | Both streams are closed on completion if true. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Input or output stream is null |