
Im currently stuck on Q2 which is to take the stdout and stderr
and print them to console. The instuction says to make a new class to do this? but I'm stuck on how to write the class
I'm still not very versed on the concept of streams. here is what i have so far
Code
//create a new process and start it, get the relevant streams
String[] token = "java FlipFlop.java 500 1000".split("[ \t\n]+")
ProcessBuilder pb = new ProcessBuilder(token);
p = pb.start
InputStream stderr = p.getErrorStream();
InputStream sstdin = p.getInputStream();
OutputStream stdout = null;
//pass stream into PipeThread class?
PipeThread pipe = new PipeThread(stderr,stdout);
can someone give me a few pointers on how to write the PipeThread class/or if im doing something wrong so far? or better some code
snippets, will don8 fg for good pointers
This post was edited by Naiva on Oct 19 2013 09:54pm