Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // credit bobobobo.wordpress.com/2008/02/23/how-to-use-zlib
- // now uncompress
- z_result = uncompress(
- dataUncompressed, // destination for the uncompressed
- // data. This should be the size of
- // the original data, which you should
- // already know.
- &sizeDataUncompressed, // length of destination (uncompressed)
- // buffer
- dataReadInCompressed, // source buffer - the compressed data
- sizeDataCompressed ); // length of compressed data in bytes
- switch( z_result )
- {
- case Z_OK:
- printf("***** SUCCESS! *****\n");
- break;
- case Z_MEM_ERROR:
- printf("out of memory\n");
- exit(1); // quit.
- break;
- case Z_BUF_ERROR:
- printf("output buffer wasn't large enough!\n");
- exit(1); // quit.
- break;
- }
Add Comment
Please, Sign In to add comment