lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

enhancement: Allow a BufferedReader to be passed to org.h2.tools.Shell #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
This will be included in the next release.

Original comment by thomas.t...@gmail.com on 27 Feb 2009 at 5:47

GoogleCodeExporter commented 9 years ago
Implemented in 1.1.108

Original comment by thomas.t...@gmail.com on 1 Mar 2009 at 10:06