Since you decided to work with strings rather than bits you need to convert your code string into a packed set of bytes containing those bits. You need to determine how to deal with the incomplete byte you are likely to have at the end (perhaps pad with zeroes and record the number of padding bits as the first three bits of the output). The order of bit packing in bytes is important if your code is not the decoder. Then write the resulting bytes to file with QIODevice::write().
A compact way to represent the dictionary is more complex, and you should try to walk before you run.
http://www.siggraph.org/education/ma..._tutorial.html
Bookmarks