class HTTP::Response::Inflater

Decompresses gzip/deflate response body streams

def initialize(connection)

Other tags:
    Api: - public

Returns:
  • (Inflater) -

Parameters:
  • connection (HTTP::Connection) -- the connection to inflate
def initialize(connection)
  @connection = connection
end

def readpartial(*)

Other tags:
    Api: - public

Raises:
  • (EOFError) - when no more data left

Returns:
  • (String) -
def readpartial(*)
  chunk = @connection.readpartial(*)
  zstream.inflate(chunk)
rescue EOFError
  unless zstream.closed?
    zstream.finished? ? zstream.finish : zstream.reset
    zstream.close
  end
  raise
end

def zstream

Other tags:
    Api: - private

Returns:
  • (Zlib::Inflate) -
def zstream
  @zstream ||= Zlib::Inflate.new(32 + Zlib::MAX_WBITS)
end