I prefer while (!strm.avail_out)