JShell with Readers and Writers

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Jun 3 16:09:13 UTC 2015


JShell has the following method:

     /**
      * Create a evaluation processing environment from which the state 
engine
      * and analysis support can be accessed.
      *
      * @param in Input for the running evaluation (it's System.in).
      * @param out Output for the running evaluation (it's System.out).
      * @param err Error output for the running evaluation (it's 
System.err).
      * @return the entry point into evaluation processing support.
      */
     public static JShell create(InputStream in, PrintStream out, 
PrintStream err) {
         return new JShellImpl(in, out, err);
     }

but while InputStream and PrintStream are convenient for hooking up to a 
Unix-like terminal window, for embedded use, it would be more convenient 
if it also had a method that took Readers and Writers, and so avoid the 
round trip from characters to bytes and back again.

-- Jon


More information about the kulla-dev mailing list