<p>I'm using the <a href="http://www.componentace.com/zlib_.NET.htm" rel="noreferrer">zlib.NET</a> library to try and inflate files that are compressed by zlib (on a Linux box, perhaps).  Here's what I'm doing:</p>

<pre><code>zlib.ZInputStream zinput =
    new zlib.ZInputStream(File.Open(path, FileMode.Open, FileAccess.Read));

while (stopByte != (data = zinput.ReadByte()))
{
  // check data here
}

zinput.Close();
</code></pre>

<p>The data bytes match the compressed data bytes, so I must be doing something wrong.</p>

Other than failing to use a "using" statement to close the stream even in the face of an exception, that looks okay to me. Is the data definitely compressed? Are you able to decompress it with zlib on the linux box?
Having looked at the source code, it's pretty ghastly - a call to
```
int Read(buffer, offset, length)
```
will end up calling its internal
```
int Read()
```
method
```
length
```
times for example. Given that sort of shaky start, I'm not sure I'd trust the code particularly heavily, but I'd have expected it to work at least
slightly
! Have you tried using
SharpZipLib
?