redirecting standard error
Hello
I've got:
legacy c code that writes to standard error
JNI c code that calls the legacy stuff
java code that calls the JNI c code
I want to capture standard error and have it available in the java code AND I don't want to redirect stderr to a file and then read that back in.
I tried:
ByteArrayOutputStream capturedStderr;
PrintStream stderrPS;
capturedStderr = new ByteArrayOutputStream();
stderrPS=new PrintStream(capturedStderr);
System.setErr(stderrPS);
hoping that capturedStderr.toString() would give me whatever was written to stderr.
It didn't ;-(
Any suggestions?
Thanks
Mark

