Re: [io] copyAndClose

2005-02-07 Thread Stephen Colebourne
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

Re: [io] copyAndClose

2005-02-06 Thread Stephen Colebourne
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);

Re: [io] copyAndClose

2005-02-06 Thread B. K. Oxley (binkley)
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);

[io] copyAndClose

2005-02-04 Thread B. K. Oxley (binkley)
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