Decompresses data from .NET streams.
Namespace:
C1.C1ZipAssembly: C1.Silverlight.Zip (in C1.Silverlight.Zip.dll)
Syntax
Remarks
To decompress data from a compressed stream, create a C1ZStreamReader object passing the compressed stream to the C1ZStreamReader constructor.
Then read the data from the C1ZStreamReader using the Read(array<Byte>[]()[][], Int32, Int32) method, or create a StreamReader on the C1ZStreamReader. The second option is indicated when you want to read formatted data.
Examples
The code below decompresses a string that was stored into a memory stream object:
Copy CodeC#

public string ExpandString(byte[] buffer) { // turn buffer into a memory stream var ms = new MemoryStream(buffer); // attach decompressor stream to memory stream var sr = new C1ZStreamReader(ms); // read uncompressed data var reader = new StreamReader(sr); return reader.ReadToEnd(); } |
Inheritance Hierarchy
System..::..Object
System..::..MarshalByRefObject
System.IO..::..Stream
C1.C1Zip..::..C1ZStreamReader
System..::..MarshalByRefObject
System.IO..::..Stream
C1.C1Zip..::..C1ZStreamReader