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_size += chunk.bytesize
		
		chunk = @stream.inflate(chunk)
		
		@output_size += chunk.bytesize
	else
		chunk = @stream.finish
		
		@output_size += chunk.bytesize
		
		@stream.close
	end
	
	return chunk.empty? ? nil : chunk
end