At present, the setStreams method of Shell takes an InputStream and two
PrintStreams. It would be useful to have a version that would take a
BufferedReader and two PrintStreams.
This would make it easier to integrate the Shell into a tool which already
operates from the command line (and so, has already wrapped System.in in a
BufferedReader).
At a glance, this should just involve adding a function like:
public void setStreams(BufferedReader reader, PrintStream out,
PrintStream err) {
this.reader = reader;
this.out = out;
this.err = err;
}
and in promptLoop() changing
reader = new BufferedReader(new InputStreamReader(in));
to
if (reader == null)
reader = new BufferedReader(new InputStreamReader(in));
Original issue reported on code.google.com by pmilli...@gmail.com on 18 Feb 2009 at 10:11
Original issue reported on code.google.com by
pmilli...@gmail.com
on 18 Feb 2009 at 10:11