title: Deflate of inflated differs from original packet for zlib
body: <p>I have an application that produces some encoded mixed string-binary packets :
  <code>ecbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ecd5f7707cf6ff76bfcfc7efe9f000000ffff</code>
  (this one is outgoing)
  So, by footer I see it's zlib(deflate). I can fully decode incoming packet just by adding &quot;789c&quot; header, but this one is a problem.</p>
  <p>This code:</p>
  <pre><code>use Compress::Zlib ;
  
  $string =&quot;789cecbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ecd5f7707cf6ff76bfcfc7efe9f000000ffff&quot;;
  # Converting to string
  while($string =~ /(\w\w)/) {
      $str = $1;
      $string =~ s/$str//;
      $value .= chr(hex($str));
  }
  $output = $value;
  my $x = inflateInit( )
     or die &quot;Cannot create a inflation stream\n&quot; ;
  ($output2, $status) = $x-&gt;inflate($value) ;
      print &quot;status:$status - error\n&quot; if $status != Z_OK and $status != Z_STREAM_END ;
      print &quot;out:&quot;.(uc unpack 'H*', $output2); print &quot;\n&quot;; 
  </code></pre>
  <p>Returns me:
  <code>out:0105303030303018000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</code></p>
  <p>It doesn't look right, like some info was changed to zeroes. And if I try to delfate the same way this ouput I have
  <code>789c62643500010986910d00000000ffff</code>
  But not the original packet. What am I missing?</p>