setOut() and redirectOutput() together (original) (raw)
Weijun Wang weijun.wang at oracle.com
Thu May 28 10:43:20 UTC 2015
- Previous message: String.contains(CharSequence) calls toString on argument
- Next message: setOut() and redirectOutput() together
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I am writing something like this
ByteArrayOutputStream bout = new ByteArrayOutputStream();
System.setOut(out);
System.out.println("Hello");
ProcessBuilder pb1 = new ProcessBuilder("./native-app");
pb1.redirectOutput(ProcessBuilder.Redirect.INHERIT);
pb1.start();
Now "Hello" no longer shows on screen, but the output of "native-app" still shows up there. What else shall I do?
This is Ubuntu 14.04.2.
Thanks Max
- Previous message: String.contains(CharSequence) calls toString on argument
- Next message: setOut() and redirectOutput() together
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]