internal void flush_pending()
{
int len = dstate.pending;
if (len > avail_out)
len = avail_out;
if (len == 0)
return ;
if (dstate.pending_buf.Length <= dstate.pending_out || next_out.Length <= next_out_index || dstate.pending_buf.Length < (dstate.pending_out + len) || next_out.Length < (next_out_index + len))
{
//System.Console.Out.WriteLine(dstate.pending_buf.Length + ", " + dstate.pending_out + ", " + next_out.Length + ", " + next_out_index + ", " + len);
//System.Console.Out.WriteLine("avail_out=" + avail_out);
}
Buffer.BlockCopy(dstate.pending_buf, dstate.pending_out, next_out, next_out_index, len);
next_out_index += len;
dstate.pending_out += len;
total_out += len;
avail_out -= len;
dstate.pending -= len;
if (dstate.pending == 0)
{
dstate.pending_out = 0;
}
}