From: B. K. Oxley (binkley) [EMAIL PROTECTED]
I do not understand. What is being copied in the finally block? Should
that have been:
finally {
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(out);
}
Oops ;-) Yes
I do not want to swallow exceptions thrown by closing in or
Well, for a start your example could be simplified.
public static void copyAndClose(final InputStream in,
final OutputStream out)
throws IOException {
try {
CopyUtils.copy(in, out);
out.flush();
} finally {
IOUtils.copyAndClose(in);
Stephen Colebourne wrote:
public static void copyAndClose(final InputStream in,
final OutputStream out)
throws IOException {
try {
CopyUtils.copy(in, out);
out.flush();
} finally {
IOUtils.copyAndClose(in);
IOUtils.copyAndClose(out);
I note in my blog:
http://binkley.blogspot.com/2005/02/methods-i-cannot-do-without.html
It would be nice to include utility methods such as this in the io
library to compliment the good set of primitives already there.
The method in question with Javadoc added:
/**
* Copies varin/var to