I'm using std.zlib in an application, and I'm having trouble decompressing a file. The file is gzipped, and I can easily see the contents with `cat file | gzip -d` but this code doesn't work:<div><div>auto arr = read("file.gz");</div>

<div>ubyte[] realarr = cast(ubyte[])uncompress(arr);</div></div><div><br></div><div>output:</div><div>std.zlib.ZlibException@std/zlib.d(59): data error</div><div><br></div><div>From the header file, it seems like zlib should be detecting a gzip header and *just working*, but, well, it isn't. I have to store data in a compressed format, and eventually the code I'm writing will be used in-memory instead of on files, so I'm going to have to uncompress it somehow.</div>

<div>Has anyone encountered this before?</div><div><br></div><div>Thanks,</div><div>Andrew</div>