IdeaBlade DevForce 2010 Help Reference
Read Method
See Also  Example Send Feedback
IdeaBlade.Core Assembly > Ionic.Zlib Namespace > GZipStream Class : Read Method



buffer
The buffer into which the decompressed data should be placed.
offset
the offset within that data array to put the first byte read.
count
the number of bytes to read.
Read and decompress data from the source stream.

Syntax

Visual Basic (Declaration) 
Public Overrides Function Read( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As GZipStream
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim value As Integer
 
value = instance.Read(buffer, offset, count)
C# 
public override int Read( 
   byte[] buffer,
   int offset,
   int count
)
C++/CLI 
public:
int Read( 
   array<byte>^ buffer,
   int offset,
   int count
) override 

Parameters

buffer
The buffer into which the decompressed data should be placed.
offset
the offset within that data array to put the first byte read.
count
the number of bytes to read.

Return Value

the number of bytes actually read

Example

C#Copy Code
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);
            }
        }
    }
}

Remarks

With a GZipStream, decompression is done through reading.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.