PipedWriter and runtime exec help

S

sublimate

I'm using runtime exec to start a java program and hijack its output
and input streams. I want to then used the PipedWriter/PipedReader
classes to write my own console filter program for the hijacked
process. the problem i'm seeing though is that I'm reading from my
"console" ok, sending data to the piped stream, reading it on the
otherside, but for some reason it seems like when i do a write on the
outputstream of the execed process the process is not getting the
input. any hints?

if i don't use piped streams and instead read a file inout the
outputstream of my file it takes that input, but of course since its
a file the interaction is not there.

Thanks ahead of time.
 
J

Joshua Cranmer

I'm using runtime exec to start a java program and hijack its output
and input streams. I want to then used the PipedWriter/PipedReader
classes to write my own console filter program for the hijacked
process. the problem i'm seeing though is that I'm reading from my
"console" ok, sending data to the piped stream, reading it on the
otherside, but for some reason it seems like when i do a write on the
outputstream of the execed process the process is not getting the
input. any hints?

if i don't use piped streams and instead read a file inout the
outputstream of my file it takes that input, but of course since its
a file the interaction is not there.

Thanks ahead of time.

Did you try flushing the data? If that doesn't work, please post some code!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top