Guest User

Untitled

a guest
Jul 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. // credit bobobobo.wordpress.com/2008/02/23/how-to-use-zlib
  2.  
  3. // now uncompress
  4.     z_result = uncompress(
  5.  
  6.         dataUncompressed,       // destination for the uncompressed
  7.                                 // data.  This should be the size of
  8.                                 // the original data, which you should
  9.                                 // already know.
  10.  
  11.         &sizeDataUncompressed,  // length of destination (uncompressed)
  12.                                 // buffer
  13.  
  14.         dataReadInCompressed,   // source buffer - the compressed data
  15.  
  16.         sizeDataCompressed );   // length of compressed data in bytes
  17.  
  18.     switch( z_result )
  19.     {
  20.     case Z_OK:
  21.         printf("***** SUCCESS! *****\n");
  22.         break;
  23.  
  24.     case Z_MEM_ERROR:
  25.         printf("out of memory\n");
  26.         exit(1);    // quit.
  27.         break;
  28.  
  29.     case Z_BUF_ERROR:
  30.         printf("output buffer wasn't large enough!\n");
  31.         exit(1);    // quit.
  32.         break;
  33.     }
Add Comment
Please, Sign In to add comment