This is to verify the losslessness of the compression and the correctness of the program. Note: This is actually for a Huffman encoder/decoder where I need to compress and decompress within the program internally and write the decompressed bits as output file. How would I do this where I have to read the bytes from the file into the BYTE list and again similarly write from the BYTE list to the file using istream and ostream respectively? Please clarify this for me. Please correct me.) and the read() function only takes char* as argument for stored bytes in memory and size of the input stream. Reading can be done with std::istream::read() or std::istreambuf_iterator (I could be very much wrong. With all the searching, I understood a couple of things. Std::ifstream File("File_Name", std::ios::binary) So, I declared, typedef unsigned char BYTE Later I need to write them back to a file, also in binary mode. I need to read the file in binary mode and store the bytes as hex values in any STL container (preferably std::list).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |