example from my project;
frequency____character____huffman code(bit)
-------------------------------------------------------------
50_____________a______________0
35_____________b______________10
20_____________k______________110
10_____________m_____________ 1110
8______________d______________11111
4______________g______________11110
This is my freq and huff code table.I have all i needs.Now i have QMap.
QMap<char,int>mymap;
//char -----> character from table
//int -----> frequency from the table
//so QMap keeping character and frequency i mean QMap my table.
QMap<char,int>mymap;
//char -----> character from table
//int -----> frequency from the table
//so QMap keeping character and frequency i mean QMap my table.
To copy to clipboard, switch view to plain text mode
Now for example my text is "aabkdgmma" so this codes(look table) are "0 0 10 110 11111 11110 1110 1110 0"->
--->"00101101111111110111011100"
//codes="00101101111111110111011100" (they are bits).
QString codes;
//codes="00101101111111110111011100" (they are bits).
To copy to clipboard, switch view to plain text mode
I want to do saving mymap and codes to file and earning size.I hope to explain my problem.How can i my bits to byte and mymap write to binary file.
Thanks for all helping and your patience.
Bookmarks