protected boolean writeResponse(InputStream in, HttpServletRequest request, HttpServletResponse response) throws IOException {
		final String sourceMethod = "writeResponse"; //$NON-NLS-1$
		final boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(AbstractAggregatorImpl.class.getName(), sourceMethod, new Object[]{in, response});
		}
		boolean success = true;
        int n = 0;
        byte[] buffer = new byte[4096];
        OutputStream out = response.getOutputStream();
        try {
	        while (-1 != (n = in.read(buffer))) {
	        	try {
	        		out.write(buffer, 0, n);
	        	} catch (IOException e) {
	        		// Error writing to the output stream, probably because the connection
	        		// was closed by the client.  Don't attempt to write anything else to
	        		// the response and just log the error using FINE level logging.
	        		logException(request, Level.FINE, sourceMethod, e);
	        		success = false;
	        		break;
	        	}
	        }
        } finally {
        	IOUtils.closeQuietly(in);
        	IOUtils.closeQuietly(out);
        }
        if (isTraceLogging) {
        	log.exiting(AbstractAggregatorImpl.class.getName(), sourceMethod, success);
        }
        return success;
	}
protected boolean writeResponse ( InputStream in , HttpServletRequest request , HttpServletResponse response ) throws IOException { final String sourceMethod = "writeResponse" ; final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( AbstractAggregatorImpl . class . getName ( ) , sourceMethod , new Object [ ] { in , response } ) ; } boolean success = true ; int n = 0 ; byte [ ] buffer = new byte [ 4096 ] ; OutputStream out = response . getOutputStream ( ) ; try { while ( - 1 != ( n = in . read ( buffer ) ) ) { try { out . write ( buffer , 0 , n ) ; } catch ( IOException e ) { logException ( request , Level . FINE , sourceMethod , e ) ; success = false ; break ; } } } finally { IOUtils . closeQuietly ( in ) ; IOUtils . closeQuietly ( out ) ; } if ( isTraceLogging ) { log . exiting ( AbstractAggregatorImpl . class . getName ( ) , sourceMethod , success ) ; } return success ; }
Writes the response to the response object. IOExceptions that occur when writing to the
response output stream are not propagated, but are handled internally. Such exceptions
are assumed to be caused by the client closing the connection and are not real errors.

@param in
the input stream.
@param request
the http request object
@param response
the http response object
@return true if all of the data from the input stream was written to the response
@throws IOException