/*
 * call-seq: << string
 *
 * Inputs +string+ into the inflate stream just like Zlib::Inflate#inflate, but
 * returns the Zlib::Inflate object itself.  The output from the stream is
 * preserved in output buffer.
 */
static VALUE
rb_inflate_addstr(obj, src)
    VALUE obj, src;
{
    struct zstream *z = get_zstream(obj);

    OBJ_INFECT(obj, src);

    if (ZSTREAM_IS_FINISHED(z)) {
        if (!NIL_P(src)) {
            StringValue(src);
            zstream_append_buffer2(z, src);
        }
    }
    else {
        do_inflate(z, src);
        if (ZSTREAM_IS_FINISHED(z)) {
            zstream_passthrough_input(z);
        }
    }

    return obj;
}