Read Method (buffer, offset, count)

DotNetZip

Ionic Zip Library v1.9.1.6 Read Method (buffer, offset, count)
ReferenceIonic.ZlibGZipStreamRead(array<Byte>[]()[][], Int32, Int32)
Read and decompress data from the source stream.
Declaration Syntax
C# Visual Basic Visual C++
public override int Read(
	byte[] buffer,
	int offset,
	int count
)
Public Overrides Function Read ( _
	buffer As Byte(), _
	offset As Integer, _
	count As Integer _
) As Integer
public:
virtual int Read(
	array<unsigned char>^ buffer, 
	int offset, 
	int count
) override
Parameters
buffer (array<Byte>[]()[][])
The buffer into which the decompressed data should be placed.
offset (Int32)
the offset within that data array to put the first byte read.
count (Int32)
the number of bytes to read.
Return Value
the number of bytes actually read
Remarks
With a GZipStream, decompression is done through reading.
Examples
CopyC#
byte[] working = new byte[WORKING_BUFFER_SIZE];
using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile))
{
    using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true))
    {
        using (var output = System.IO.File.Create(_DecompressedFile))
        {
            int n;
            while ((n= decompressor.Read(working, 0, working.Length)) !=0)
            {
                output.Write(working, 0, n);
            }
        }
    }
}

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)