Read and decompress data from the source stream.
Syntax
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) |
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
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