This commit is contained in:
Andrey Gumirov
2024-01-11 13:48:10 +07:00
parent a2b5c8117d
commit b9b0ab5edb
4 changed files with 54 additions and 60 deletions

View File

@ -20,6 +20,7 @@ void MashZip::unmashzip_stream(std::basic_istream<char> &is, std::basic_ostream<
// load huffman table
HuffmanTable ht(header);
ibitstream ibs(is);
char sym = '\0';
@ -40,13 +41,11 @@ void MashZip::unmashzip_stream(std::basic_istream<char> &is, std::basic_ostream<
void MashZip::mashzip_file(std::basic_istream<char> &cs, std::basic_istream<char> &is, std::basic_ostream<char> &os)
{
// std::ifstream ifs(name, std::ios::binary);
// is.seekg(0);
os.write(MAGIC, 4);
// build huffman table by file
HuffmanTable ht(cs);
// is.seekg(0); // reset position as ht reads whole file
os.write(ht.to_header(), HEADER_SIZE);