public static void copyThenClose ( InputStream input , OutputStream output ) throws IOException { copy ( input , output ) ; input . close ( ) ; output . close ( ) ; }
Copies information between specified streams and then closes both of the streams .