flush(p1 = v1)
public
This method is equivalent to deflate('', flush). If flush is omitted, SYNC_FLUSH
is used as flush. This method is
just provided to improve the readability of your Ruby program.
Please visit your zlib.h for a deeper detail on NO_FLUSH, SYNC_FLUSH,
FULL_FLUSH, and FINISH
Show source
static VALUE
rb_deflate_flush(int argc, VALUE *argv, VALUE obj)
{
struct zstream *z = get_zstream(obj);
VALUE v_flush, dst;
int flush;
rb_scan_args(argc, argv, "01", &v_flush);
flush = FIXNUMARG(v_flush, Z_SYNC_FLUSH);
if (flush != Z_NO_FLUSH) { /* prevent Z_BUF_ERROR */
zstream_run(z, (Bytef*)"", 0, flush);
}
dst = zstream_detach_buffer(z);
OBJ_INFECT(dst, obj);
return dst;
}