-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to compress / decompress an array of bytes? #229
Comments
Usually, you don't want to directly use
What is the exact error message and error code thrown by bit7z?
The same applies to the |
Thank you for your time and your gracious help. I tried the following:
This throws an exception in |
The problem is that, in your function, you're not adding any data to the archive (e.g., using |
That makes sense. Thank you again! I've now managed to make it work. |
No problem! As a side note, I definitely need to improve the error message and code in such cases, as 7-Zip is really not good at reporting the causes of such errors, unfortunately.
I took a look at your code and it seems fine to me. void BZip7::decompress(const std::vector<bit7z::byte_t>& data, std::vector<bit7z::byte_t>& decompressed) const
{
try
{
bit7z::BitArchiveReader reader(lib, data, bit7z::BitFormat::GZip);
reader.extractTo(decompressed);
std::cout << "Decompression succeeded!" << std::endl;
}
catch (bit7z::BitException ex)
{
std::cout << "Decompression failed! " << ex.what() << std::endl;
}
} |
I've been trying to compress / decompress a vector of bytes by feeding it into a BitOutputArchive or a BitInputArchive respectively. This was rejected as unpermitted operation. Should I use BitMemoryCompressor? How?
Any help would be appreciated.
Greetings,
Axel
The text was updated successfully, but these errors were encountered: