C# Streaming Decompression Example (from System.IO.Stream –> System.IO.Stream)

[code language=”csharp”] // Streaming decompression from System.IO.Stream –> System.IO.Stream // In this example, the source and sink streams are files. // However, they can be any type of System.IO.Stream, such as a System.Net.Sockets.NetworkStream System.IO.FileStream fsSource = File.OpenRead("qa_data/image.compressed"); Chilkat.StreamConnector scSource = new Chilkat.StreamConnector(); System.IO.FileStream fsSink = File.OpenWrite("qa_data/image.bmp"); Chilkat.StreamConnector scSink = new …

C++ String Compression: PPMD, Deflate, BZip2, LZW

This C++ example demonstrates string compression using four different compression algorithms: PPMD, Deflate, BZip2, and LZW. void TestCompression(const char *algorithm) { CkCompression comp; comp.put_Algorithm(algorithm); printf (“algorithm: %s\n”,algorithm); CkByteData compressedData; comp.CompressString(“abc abc abc abc abc abc abc abc abc abc abc 123 123 abc 123”,compressedData); // Get the compressed data: const …

VB.NET Compress String to Byte Array

Demonstrates how to use Chilkat.Compression to compress a string to a byte array: Private Sub CompressStringToBytes() Dim compress As New Chilkat.Compression() ‘ Any string argument automatically begins a 30-day trial. Dim success As Boolean success = compress.UnlockComponent(“30-day trial”) If (success <> True) Then MsgBox(“Compression component unlock failed”) Exit Sub End …