MCPcopy Create free account
hub / github.com/apache/tomcat / copy

Method copy

java/org/apache/catalina/servlets/DefaultServlet.java:2576–2590  ·  view source on GitHub ↗

Copy the contents of the specified input stream to the specified output stream, and ensure that the input stream is closed before returning (even in the face of an exception). @param is The input stream to read the source resource from @param ostream The output stream to write to @exception I

(InputStream is, ServletOutputStream ostream)

Source from the content-addressed store, hash-verified

2574 * @exception IOException if an input/output error occurs
2575 */
2576 protected void copy(InputStream is, ServletOutputStream ostream) throws IOException {
2577
2578 InputStream istream = new BufferedInputStream(is, input);
2579
2580 // Copy the input stream to the output stream
2581 IOException exception = copyNoThrow(istream, ostream);
2582
2583 // Clean up the input stream
2584 istream.close();
2585
2586 // Rethrow any exception that has occurred
2587 if (exception != null) {
2588 throw exception;
2589 }
2590 }
2591
2592
2593 /**

Callers 1

serveResourceMethod · 0.95

Calls 8

copyNoThrowMethod · 0.95
getStartMethod · 0.95
getEndMethod · 0.95
getEntriesMethod · 0.80
closeMethod · 0.65
getInputStreamMethod · 0.65
printlnMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected