internal void bi_flush()
{
if (bi_valid == 16)
{
pending[pendingCount++] = (byte)bi_buf;
pending[pendingCount++] = (byte)(bi_buf >> 8);
bi_buf = 0;
bi_valid = 0;
}
else if (bi_valid >= 8)
{
//put_byte((byte)bi_buf);
pending[pendingCount++] = (byte)bi_buf;
bi_buf >>= 8;
bi_valid -= 8;
}
}