Method: Zlib::GzipReader#getbyte

Defined in:
ext/zlib/zlib.c

#getbyteObject

See Zlib::GzipReader documentation for a description.



4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
# File 'ext/zlib/zlib.c', line 4059

static VALUE
rb_gzreader_getbyte(VALUE obj)
{
    struct gzfile *gz = get_gzfile(obj);
    VALUE dst;

    dst = gzfile_read(gz, 1);
    if (!NIL_P(dst)) {
	dst = INT2FIX((unsigned int)(RSTRING_PTR(dst)[0]) & 0xff);
    }
    return dst;
}