title: C++ - Zip Utils unzipping from memory to memory
body: <p>While searching how to easy (without any dlls,...) unzip in C++, I came around <a href="http://www.wischik.com/lu/programmer/zip_utils.html" rel="nofollow">Zip Utils</a>.</p>
  
  <p>I download data from server (compressed in PHP using <code>gzencode()</code>) to local buffer, now I'd like to uncompress it either using Zip Utils or something else.</p>
  
  <p>Lets say I have :</p>
  
  <pre><code>char zipped[100000];
  
  char unzipped[100000];
  </code></pre>
  
  <p>now I'd like to unzip data from one buffer to other, how exactly do I do that using Zip Utils?</p>
  
  <p>EDIT:
  I've tried unzipping myself, but I cannot get it working. Here is the one example of how I tried.</p>
  
  <pre><code> HZIP hz = OpenZip(zipped, sizeof zipped, "");
              char buf[1024]; ZRESULT zr = ZR_MORE; unsigned long totsize = 0;
              while (zr == ZR_MORE)
              {
                  ZIPENTRY ze; GetZipItem(hz, 0, &amp;ze);
                  zr = UnzipItem(hz, 0, unzipped, sizeof unzipped);
                  unsigned long bufsize = 1024; if (zr == ZR_OK) bufsize = ze.unc_size - totsize;
                      totsize += bufsize;
              }
              CloseZip(hz);
  </code></pre>