You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/09/18 22:58:18 UTC
svn commit: r577055 -
/geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java
Author: jdillon
Date: Tue Sep 18 13:58:17 2007
New Revision: 577055
URL: http://svn.apache.org/viewvc?rev=577055&view=rev
Log:
Expose autoFlush settings for new streams
Modified:
geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java
Modified: geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java?rev=577055&r1=577054&r2=577055&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/IO.java Tue Sep 18 13:58:17 2007
@@ -83,11 +83,12 @@
/**
* Construct a new IO container.
*
- * @param in The input steam; must not be null
- * @param out The output stream; must not be null
- * @param err The error output stream; must not be null
+ * @param in The input steam; must not be null
+ * @param out The output stream; must not be null
+ * @param err The error output stream; must not be null
+ * @param autoFlush True to enable auto-flushing off writers.
*/
- public IO(final InputStream in, final OutputStream out, final OutputStream err) {
+ public IO(final InputStream in, final OutputStream out, final OutputStream err, final boolean autoFlush) {
assert in != null;
assert out != null;
assert err != null;
@@ -103,11 +104,33 @@
// be ANSI-aware instead of this...
//
- this.out = new RenderWriter(outputStream, true);
- this.err = new RenderWriter(errorStream, true);
+ this.out = new RenderWriter(outputStream, autoFlush);
+ this.err = new RenderWriter(errorStream, autoFlush);
- // this.out = new PrintWriter(out, true);
- // this.err = new PrintWriter(err, true);
+ // this.out = new PrintWriter(out, autoFlush);
+ // this.err = new PrintWriter(err, autoFlush);
+ }
+
+ /**
+ * Construct a new IO container.
+ *
+ * @param in The input steam; must not be null
+ * @param out The output stream; must not be null
+ * @param err The error output stream; must not be null
+ */
+ public IO(final InputStream in, final OutputStream out, final OutputStream err) {
+ this(in, out, err, true);
+ }
+
+ /**
+ * Construct a new IO container.
+ *
+ * @param in The input steam; must not be null
+ * @param out The output stream and error stream; must not be null
+ * @param autoFlush True to enable auto-flushing off writers.
+ */
+ public IO(final InputStream in, final OutputStream out, final boolean autoFlush) {
+ this(in, out, out, autoFlush);
}
/**
@@ -119,6 +142,7 @@
public IO(final InputStream in, final OutputStream out) {
this(in, out, out);
}
+
/**
* Helper which uses current values from {@link System}.