public static int copy(InputStream in,OutputStream out) throws IOException {
  Assert.notNull(in,"No InputStream specified");
  Assert.notNull(out,"No OutputStream specified");
  try {
    return StreamUtils.copy(in,out);
  }
  finally {
    try {
      in.close();
    }
 catch (    IOException ex) {
    }
    try {
      out.close();
    }
 catch (    IOException ex) {
    }
  }
}

public static int copy ( InputStream in , OutputStream out ) throws IOException { Assert . notNull ( in , "No InputStream specified" ) ; Assert . notNull ( out , "No OutputStream specified" ) ; try { return StreamUtils . copy ( in , out ) ; } finally { try { in . close ( ) ; } catch ( IOException ex ) { } try { out . close ( ) ; } catch ( IOException ex ) { } } }
copy the contents of the given inputstream to the given outputstream . closes both streams when done .
