Hi,
I am trying to read(append incoming data into a local String) from a PrintStram in the following code block:
System.out.println("Starting Login Test Cases...");
out = new PrintStream(new ByteArrayOutputStream());
command_feeder = new PipedWriter();
PipedReader in = new PipedReader(command_feeder);
main_controller = new Controller(in, out);
for(int i = 0; i < cases.length; i++)
{
command_feeder.write(cases[i]);
}
main_controller will be writing some strings to its out(PrintStream), then how can I read from this PrintStream assuming I can't change any code in Controller class? Thanks in advance.