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
Post a Comment