S
sinleeh
Dear All,
I need to run a command line program inside my java program. Hence, I
have to use
Process proc = Runtime.getRuntime().exec("myprogram");
to run the command line program for me.
Unfortunately, I have to cache and interpret output from "myprogram".
The output can be very long and therefore can cause buffer overflow. It
can come from either the outputstream or the errorstream. I see that
Java provide Process.getOutputStream() and Process.getErrorStream() for
this purpose but I have problem reading data out from them. Can someone
point me to the correct direction please?
Many thanks and best regards
Sinleeh
I need to run a command line program inside my java program. Hence, I
have to use
Process proc = Runtime.getRuntime().exec("myprogram");
to run the command line program for me.
Unfortunately, I have to cache and interpret output from "myprogram".
The output can be very long and therefore can cause buffer overflow. It
can come from either the outputstream or the errorstream. I see that
Java provide Process.getOutputStream() and Process.getErrorStream() for
this purpose but I have problem reading data out from them. Can someone
point me to the correct direction please?
Many thanks and best regards
Sinleeh