Sample code for 30+ languages & platforms
.NET Core C#

Decompress Bytes

See more Compression Examples

Demonstrates how to decompress binary data.

Chilkat .NET Core C# Downloads

.NET Core C#
bool success = false;

// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

// See this example to compress bytes: Compress Bytes

Chilkat.FileAccess fac = new Chilkat.FileAccess();

byte[] compressedBytes = null;
compressedBytes = fac.ReadEntireFile("qa_data/compressed/compressedBmp.dat");
if (fac.LastMethodSuccess != true) {
    Debug.WriteLine(fac.LastErrorText);
    return;
}

Chilkat.Compression compress = new Chilkat.Compression();
compress.Algorithm = "deflate";

byte[] decompressedBytes = null;
decompressedBytes = compress.DecompressBytes(compressedBytes);
if (compress.LastMethodSuccess != true) {
    Debug.WriteLine(compress.LastErrorText);
    return;
}

success = fac.WriteEntireFile("qa_output/decompressed.bmp",decompressedBytes);
if (fac.LastMethodSuccess != true) {
    Debug.WriteLine(fac.LastErrorText);
    return;
}