+ // ECMA48Terminal is the screen too
+ screen = terminal;
+ }
+
+ /**
+ * Public constructor.
+ *
+ * @param listener the object this backend needs to wake up when new
+ * input comes in
+ * @param input the InputStream underlying 'reader'. Its available()
+ * method is used to determine if reader.read() will block or not.
+ * @param reader a Reader connected to the remote user.
+ * @param writer a PrintWriter connected to the remote user.
+ * @param setRawMode if true, set System.in into raw mode with stty.
+ * This should in general not be used. It is here solely for Demo3,
+ * which uses System.in.
+ * @throws IllegalArgumentException if input, reader, or writer are null.
+ */
+ public ECMA48Backend(final Object listener, final InputStream input,
+ final Reader reader, final PrintWriter writer,
+ final boolean setRawMode) {
+
+ // Create a terminal and explicitly set stdin into raw mode
+ terminal = new ECMA48Terminal(listener, input, reader, writer,
+ setRawMode);
+
+ // Keep the terminal's sessionInfo so that TApplication can see it
+ sessionInfo = terminal.getSessionInfo();