class Protocol::HTTP::Body::Readable

end
def close(error = nil) -> close the stream immediately.
def finish -> buffer the stream and close it.

def call(stream)

def call(stream)
	# Flushing after every chunk is inefficient, but it's also a safe default.
	self.each do |chunk|
		stream.write(chunk)
		stream.flush
	end
end

def close(error = nil)

The consumer can call stop to signal that the stream output has terminated.
def close(error = nil)
end

def each

Enumerate all chunks until finished, then invoke `#close`.
def each
	while chunk = self.read
		yield chunk
		# chunk.clear
	end
ensure
	self.close($!)
end

def empty?

Will read return any data?
def empty?
	false
end

def finish

Read all remaining chunks into a buffered body and close the underlying input.
def finish
	# Internally, this invokes `self.each` which then invokes `self.close`.
	Buffered.for(self)
end

def join

Read all remaining chunks into a single binary string using `#each`.
def join
	buffer = String.new.force_encoding(Encoding::BINARY)
	
	self.each do |chunk|
		buffer << chunk
		chunk.clear
	end
	
	return buffer
end

def length

def length
	nil
end

def read

Read the next available chunk.
def read
	nil
end