/** * Construct a new IO container. */ public IO(final InputStream inputStream, final OutputStream outputStream, final OutputStream errorStream) { assert inputStream != null; assert outputStream != null; assert errorStream != null; this.inputStream = inputStream; this.outputStream = outputStream; this.errorStream = errorStream; this.in = new InputStreamReader(inputStream); this.out = new AnsiRenderWriter(outputStream, true); this.err = new AnsiRenderWriter(errorStream, true); }
@Override public PrintWriter format(final String format, final Object... args) { print(String.format(format, args)); return this; }
@Override public PrintWriter format(final Locale l, final String format, final Object... args) { print(String.format(l, format, args)); return this; } }
@Override protected PrintWriter createWriter(final PrintStream out, final boolean autoFlush) { assert out != null; return new AnsiRenderWriter(out, autoFlush); } }
/** * Construct a new IO container. */ public IO(final InputStream inputStream, final OutputStream outputStream, final OutputStream errorStream) { assert inputStream != null; assert outputStream != null; assert errorStream != null; this.inputStream = inputStream; this.outputStream = outputStream; this.errorStream = errorStream; this.in = new InputStreamReader(inputStream); this.out = new AnsiRenderWriter(outputStream, true); this.err = new AnsiRenderWriter(errorStream, true); }