protected void appendStream ( final InputStream input , final OutputStream output ) throws MojoExecutionException { // prebuffer int character ; try { // get line seperator, based on system final String newLine = System . getProperty ( "line.separator" ) ; // read & write while ( ( character = input . read ( ) ) != - 1 ) { output . write ( character ) ; } // append newline output . write ( newLine . getBytes ( ) ) ; // flush output . flush ( ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "Error in buffering/writing " + e . getMessage ( ) , e ) ; } }
Appends inputstream to outputstream