@Override public void write(final int b) { get().write(b); }
/** * Install the hijacker. */ public static synchronized void install() { if (installed) { throw new IllegalStateException("Already installed"); } // Capture the current set of streams previous = new StreamSet(System.in, System.out, System.err); // Install our streams System.setIn(new DelegateInputStream()); System.setOut(new DelegateOutputStream(StreamSet.OutputType.OUT)); System.setErr(new DelegateOutputStream(StreamSet.OutputType.ERR)); installed = true; log.debug("Installed"); }
@Override public void flush() { get().flush(); }
@Override public void write(final byte b[]) throws IOException { get().write(b, 0, b.length); }
@Override public void close() { get().close(); } }
@Override public void write(final byte[] b, final int off, final int len) { get().write(b, off, len); }