class Falcon::Adapters::Output

def self.wrap(headers, body)

Wraps an array into a buffered body.
def self.wrap(headers, body)
	if body.is_a?(Async::HTTP::Body::Readable)
		return body
	# This needs more testing:
	elsif body.respond_to?(:to_path)
		return Async::HTTP::Body::File.open(body.to_path)
	else
		return self.new(headers, body)
	end
end

def empty?

def empty?
	@length == 0
end

def initialize(headers, body)

def initialize(headers, body)
	# We don't trust the user to provide the right length to the transport.
	@length = headers.delete(CONTENT_LENGTH)
	
	@body = body
	@chunks = body.to_enum(:each)
end

def inspect

def inspect
	"\#<#{self.class} length=#{@length.inspect} body=#{@body.class}>"
end

def read

def read
	@chunks.next
rescue StopIteration
	nil
end