class Async::HTTP::Body::Inflate

def self.for(body, encoding = GZIP)

def self.for(body, encoding = GZIP)
	self.new(body, Zlib::Inflate.new(encoding))
end

def read

def read
	return if @stream.closed?
	
	if chunk = super
		@input_length += chunk.bytesize
		
		chunk = @stream.inflate(chunk)
		
		@output_length += chunk.bytesize
	else
		chunk = @stream.finish
		
		@output_length += chunk.bytesize
		
		@stream.close
	end
	
	return chunk.empty? ? nil : chunk
end