public override void Write(byte[] b, int off, int len)
{
if (len == 0)
return;
z.next_in = b;
z.next_in_index = off;
z.avail_in = len;
do
{
z.next_out = buf;
z.next_out_index = 0;
z.avail_out = buf.Length;
int err = compress
? z.deflate(flushLevel)
: z.inflate(flushLevel);
if (err != JZlib.Z_OK)
// TODO
// throw new ZStreamException((compress ? "de" : "in") + "flating: " + z.msg);
throw new IOException((compress ? "de" : "in") + "flating: " + z.msg);
output.Write(buf, 0, buf.Length - z.avail_out);
}
while (z.avail_in > 0 || z.avail_out == 0);
}