<div class="gmail_quote">On Tue, Jul 19, 2011 at 10:14 AM, Andrew Wiley <span dir="ltr"><<a href="mailto:wiley.andrew.j@gmail.com">wiley.andrew.j@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><div></div><div class="h5"><div class="gmail_quote">On Tue, Jul 19, 2011 at 9:57 AM, Jesse Phillips <span dir="ltr"><<a href="mailto:jessekphillips%2BD@gmail.com" target="_blank">jessekphillips+D@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Andrew Wiley Wrote:<br>
<br>
> I know, but if you look at the docs for the inflate functions, zlib is<br>
> supposed to be autodetecting the gzip header and uncompressing the payload<br>
> correctly, if I understand the documentation (which I probably don't at this<br>
> point).<br>
<br>
</div>Not sure what documentation you are talking of. But it doesn't sound like it does auto detection, an answer to one of the question:<br>
<br>
"You can request that deflate write the gzip format instead of the zlib format using deflateInit2(). You can also request that inflate decode the gzip format using inflateInit2(). Read zlib.h for more details."<br>



</blockquote></div><br></div></div><div>Ah, I stand corrected:</div><div>"inflate() can decompress and check either zlib-wrapped or gzip-wrapped</div><div>  deflate data.  The header type is detected automatically, if requested when</div>


<div>  initializing with inflateInit2()."</div>
</blockquote></div><br><div>Looks like this is the solution:</div><div>ubyte[] realarr = cast(ubyte[])uncompress(arr, 0, 47);</div><div>The 47 makes zlib autodetect the header (because the 32 bit is set; if you wanted to force gzip, you'd set the 16 bit).</div>

<div><br></div>