private static PumpStreamHandler redirectOutputAlsoTo ( PumpStreamHandler pumps , OutputStream output ) { if ( output == null ) throw new IllegalArgumentException ( "OutputStream must be provided." ) ; OutputStream current = pumps . getOut ( ) ; if ( current != null && ! ( current instanceof NullOutputStream ) ) { output = new TeeOutputStream ( current , output ) ; } return new PumpStreamHandler ( output , pumps . getErr ( ) , pumps . getInput ( ) ) ; }
Redirects the process output stream also to a given output stream .