VB example Visual C++ example Delphi example C# example VB.NET example
In the descriptions below, you can freely replace the word "compress" with "decompress" in order to find out how to decompress data, because compressing and decompressing works exactly the same way.
To compress data from memory and place it directly into a file, perform the following 3 steps. Put the Xceed Streaming Compression control on a form or instantiate it, then:
Specify the format for the resulting compressed data. To do this, set the CompressionFormat property.
Tell the library to compress. To do this, call the WriteFile method, passing your source memory buffer, the destination filename and specifying True for the bEndOfData parameter.
Make sure that everything worked properly. To do this, use your language's error handling object or error handling capabilities. The Xceed Streaming Compression Library supports standard COM error handling functionality.
To compress data from memory and place it directly into a file as data becomes available, perform the following 4 steps. Put the Xceed Streaming Compression Control on a form or instantiate it, then:
Specify the format for the resulting compressed data. To do this, set the CompressionFormat property.
Provide each block of data to the library as it becomes available. To do this, call the WriteFile method for each portion of data, passing the memory buffer with a portion of the data, the destination filename and specifying False for the bEndOfData parameter.
Continue providing blocks of data to compress until you're done. When there is no more data to compress, call the Compress method with a final (or empty) block of data to compress and specify True for the bEndOfData parameter.
Make sure that everything worked properly. To do this, use your language's error handling object or error handling capabilities. The Xceed Streaming Compression Library supports standard COM error handling functionality.