This topic demonstrates how to decompress a compressed byte array using the static Decompress method if the QuickCompression class.
Basic steps
To decompress a compressed byte array, the following steps must be taken:
-
Retrieve a byte array containing the compressed data. For the purposes of this example, our compressed data is the data compressed using the Compress example.
-
Decompress the data. The resulting compressed data will be returned as a byte array.
Demonstration
The following example demonstrates how to decompress an array of bytes using the static Decompress method of the QuickCompression class.
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
using Xceed.Compression;
|
Things you should consider
The main questions you should ask yourself when compressing data read from a stream are:
-
Do you want to decompress data as it is read from a stream? Use the Read method of the CompressedStream class.
-
Do you need to convert the resulting decompressed byte array to a string? Use the GetString method of the .NET Framework's System.Text.Encoding class.