I am trying to read (add incoming data to a local line) from 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 write some lines to its file (PrintStream), then how can I read from this PrintStream, assuming that I cannot change any code in the controller class? Thanks in advance.
java io
Midnight blue
source share