class Async::HTTP::Body::Chunked

def read

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