java - How do you pipe an OutputStream and InputStream to console? -



java - How do you pipe an OutputStream and InputStream to console? -

when running process, how pipe it's output system.out , it's input system.in:

process p = runtime.getruntime().exec("cubc.exe"); // p.getoutputstream())

edit: think explained wrong; don't want input program, want user input program, , don't want read output, want user read output.

using ioutils class apache commons io:

process p = runtime.getruntime().exec("cubc.exe"); ioutils.copy(p.getinputstream(), system.out);

java inputstream outputstream

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -