/** * Creates a Console that reads from and writes to the provided streams. * * @param in the console's input stream * @param out the console's output stream */ public Console(InputStream in, OutputStream out) { this.in = in; this.cursorBuffer = new StringBuffer(); this.ansiEnabled = true; this.forceAnsi = false; try { this.ansiSupported = checkAnsiSupported(out, checkOS()); } catch (UnsatisfiedLinkError e) { this.ansiSupported = false; } catch (Throwable e) { this.ansiSupported = false; } if (out instanceof PrintStream) { this.out = (PrintStream) out; } else { boolean autoFlush = true; this.out = new PrintStream(out, autoFlush); } }
/** * Creates a Console that reads from and writes to the provided streams. * * @param in the console's input stream * @param out the console's output stream */ public Console(InputStream in, OutputStream out) { this.in = in; this.cursorBuffer = new StringBuffer(); this.ansiEnabled = true; this.forceAnsi = false; try { this.ansiSupported = checkAnsiSupported(out, checkOS()); } catch (UnsatisfiedLinkError e) { this.ansiSupported = false; } catch (Throwable e) { this.ansiSupported = false; } if (out instanceof PrintStream) { this.out = (PrintStream) out; } else { boolean autoFlush = true; this.out = new PrintStream(out, autoFlush); } }
/** * Creates a Console that reads from and writes to the provided streams. * * @param in the console's input stream * @param out the console's output stream */ public Console(InputStream in, OutputStream out) { this.in = in; this.cursorBuffer = new StringBuffer(); this.ansiEnabled = true; this.forceAnsi = false; try { this.ansiSupported = checkAnsiSupported(out, checkOS()); } catch (UnsatisfiedLinkError e) { this.ansiSupported = false; } catch (Throwable e) { this.ansiSupported = false; } if (out instanceof PrintStream) { this.out = (PrintStream) out; } else { boolean autoFlush = true; this.out = new PrintStream(out, autoFlush); } }