I’m using the zlib.NET library to try and inflate files that are compressed by zlib (on a Linux box, perhaps). Here’s what I’m doing:
zlib.ZInputStream zinput = new zlib.ZInputStream(File.Open(path, FileMode.Open, FileAccess.Read)); while (stopByte != (data = zinput.ReadByte())) { // check data here } zinput.Close();
The data bytes match the compressed data bytes, so I must be doing something wrong.
It appears I made the mistake of assuming all virtual methods were overridden, which wasn’t the case. I was using zlib.ZInputStream.ReadByte(), which is just the inherited Stream.ReadByte(), which doesn’t do any inflate.
I used zlib.ZInputStream.Read() instead, and it worked like it should.