class Async::HTTP::Body::Chunked

def read

def read
	return nil if @finished
	
	length = @protocol.read_line.to_i(16)
	
	if length == 0
		@finished = true
		@protocol.read_line
		
		return nil
	end
	
	chunk = @protocol.stream.read(length)
	@protocol.read_line # Consume the trailing CRLF
	
	@length += length
	@count += 1
	
	return chunk
end