Move the code for copy a specific amount to IOUtils
Don't cache the input stream unless we have gotten through the service invoke phase.  If there is an exception or similar on input, there is no need to cache it, just discard what we can.
Recording .gitmergeinfo Changes