def inflate(data)
      data = Type.coerce_to data, String, :to_str unless data.nil?

      if finished? then
        if data.nil? then
          unzipped = detatch_output
        else
          @input ||= ''
          @input << data

          unzipped = ''
        end
      else
        if data.nil? then
          run '', Zlib::FINISH
        elsif not data.empty? then
          run data, Zlib::SYNC_FLUSH
        end

        unzipped = detatch_output

        if finished? and not @input.nil? then
          expand_output
        end
      end

      unzipped
    end
def inflate(data)
      data = Type.coerce_to data, String, :to_str unless data.nil?

      if finished? then
        if data.nil? then
          unzipped = detatch_output
        else
          @input ||= ''
          @input << data

          unzipped = ''
        end
      else
        if data.nil? then
          run '', Zlib::FINISH
        elsif not data.empty? then
          run data, Zlib::SYNC_FLUSH
        end

        unzipped = detatch_output

        if finished? and not @input.nil? then
          expand_output
        end
      end

      unzipped
    end
Inputs +string+ into the inflate stream and returns the output from the
 stream.  Calling this method, both the input and the output buffer of
 the stream are flushed.  If string is +nil+, this method finishes the
 stream, just like Zlib::ZStream#finish.

 Raises a Zlib::NeedDict exception if a preset dictionary is needed to
 decompress.  Set the dictionary by Zlib::Inflate#set_dictionary and then
 call this method again with an empty string.  (<i>???</i>)