public static void copy ( InputStream inputStream , OutputStream outputStream , boolean closeInputStream ) throws IOException { try { ByteStreams . copy ( inputStream , outputStream ) ; } finally { if ( closeInputStream ) { inputStream . close ( ) ; } } }
Writes the content provided by the given source input stream into the given destination output stream optionally closing the input stream .