So I have an array of bytes that I would like to decompress using the uncompress
function in zlib
but it always returns Z_DATA_ERROR
. So my question is, does zlib support .zip files?
code:
const unsigned char zip [] = { /*some bytes*/};
unsigned char* decompressed = new unsigned char[decompressedSize];
unsigned char* compressed = new unsigned char[zipSize];
int result = uncompress(decompressed, &decompressedSize, zip, zipSize);
From faq
Can zlib handle .zip archives?
Not by itself, no. See the directory contrib/minizip in the zlib distribution.
see: http://www.zlib.net/zlib_faq.html#faq11