GetDecompressionStream Method
Creates an input stream used to read data from a compressed stream.
Syntax
public System.IO.Stream GetDecompressionStream(System.IO.Stream baseStream);
Public Function GetDecompressionStream(ByVal BaseStream As System.IO.Stream) As System.IO.Stream
Remarks
GetDecompressionStream returns a System.IO.Stream used to read the decompressed data from a compressed stream. The BaseStream parameter should be the System.IO.Stream providing the compressed data.
The format (zlib or gzip) is selected with the StreamFormat property; zlib is the default.
The return value provides the following standard System.IO.Stream methods. Please see the official .NET Framework documentation for details.
public bool CanRead { get }
Returns true.
public void Close()
Closes the stream. Also closes BaseStream if CloseBaseStream is set to true before this stream is created.
public int Read(byte[] b, int off, int len)
Reads decompressed data into the provided byte array, and returns the number of bytes actually read. Returns -1 if the stream was finished.
public int ReadByte()
Reads a single byte of data from the input stream. Returns -1 if no data was able to be read.
Other System.IO.Stream methods will throw a NotSupportedException.