Posted By:
Anonymous
Posted On:
Thursday, September 6, 2001 01:09 AM
Hi, I'd like to capture the stdout "stream" of my Native DLL/shared library (both C ) to my own Java console. So far I managed successfully to call native methods, and redirect System.out to capture Java print statements. Also I managed output redirection if I don't use a DLL/shared object, but calling an exe program with: String str = null; Process proc = Runtime.getRuntime().exec("EXEprogram"); DataInputStream in = new DataInputStream( proc.getInputStream()); try { while ((str = in.readLine()) != null) { System.out.println(str); } But the process seem
More>>
Hi,
I'd like to capture the stdout "stream"
of my Native DLL/shared library (both C )
to my own Java console. So far I managed
successfully to call native methods,
and redirect System.out to capture Java
print statements. Also I managed output
redirection if I don't use a DLL/shared
object, but calling an exe
program with:
String str = null;
Process proc = Runtime.getRuntime().exec("EXEprogram");
DataInputStream in = new DataInputStream(
proc.getInputStream());
try {
while ((str = in.readLine()) != null) {
System.out.println(str);
}
But the process seems to be running much slower then the DLL/shared
object version.
And I can't capture the print statements of the Native Shared Library so
far.
Is there any "easy" way to do this, ie without having to edit 100,000
lines of existing
C code to send its output to my console.
Thanks in advance,
Alex
<<Less