public static int copy ( InputStream is , OutputStream os , boolean closeOs ) { if ( closeOs ) { return write ( is ) . ensureCloseSink ( ) . to ( os ) ; } else { return write ( is ) . to ( os ) ; } }
Copy an stream to another one . It close the input stream anyway .