VB example VC++ example Delphi example C# example VB.NET example
In the descriptions below, you can freely replace the word "encode" with "decode" in order to find out how to decode data, because encoding and decoding work exactly the same way.
To encode data from memory and place it directly into a file, perform the following 3 steps. Put the Xceed Binary Encoding control on a form or instantiate it, then:
Specify the format for the resulting encoded data. To do this, set the EncodingFormat property.
Tell the library to encode. 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 Binary Encoding Library supports standard COM error handling functionality.
To encode data from memory and place it directly into a file as data becomes available, perform the following 4 steps. Put the Xceed Binary Encoding Control on a form or instantiate it, then:
Specify the format for the resulting encoded data. To do this, set the EncodingFormat 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 encode until you're done. When there is no more data to encode, call the Encode method with a final (or empty) block of data to encode 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 Binary Encoding Library supports standard COM error handling functionality.