(.NET Core C#) Decompress Bytes
Demonstrates how to decompress binary data.
// 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;
}
bool success = fac.WriteEntireFile("qa_output/decompressed.bmp",decompressedBytes);
if (fac.LastMethodSuccess != true) {
Debug.WriteLine(fac.LastErrorText);
return;
}
|