module Protocol::HTTP2::Continued

def pack(data, **options)

def pack(data, **options)
	maximum_size = options[:maximum_size]
	
	if maximum_size and data.bytesize > maximum_size
		clear_flags(END_HEADERS)
		
		super(data.byteslice(0, maximum_size), **options)
		
		remainder = data.byteslice(maximum_size, data.bytesize-maximum_size)
		
		@continuation = ContinuationFrame.new
		@continuation.pack(remainder, maximum_size: maximum_size)
	else
		set_flags(END_HEADERS)
		
		super data, **options
		
		@continuation = nil
	end
end