read(p1 = v1)
public
Show source
static VALUE
rb_gzreader_read(int argc, VALUE *argv, VALUE obj)
{
struct gzfile *gz = get_gzfile(obj);
VALUE vlen;
long len;
rb_scan_args(argc, argv, "01", &vlen);
if (NIL_P(vlen)) {
return gzfile_read_all(gz);
}
len = NUM2INT(vlen);
if (len < 0) {
rb_raise(rb_eArgError, "negative length %ld given", len);
}
return gzfile_read(gz, len);
}