[jboss-svn-commits] JBoss Common SVN: r3916 - jboss-stdio/trunk/src/main/java/org/jboss/stdio.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jan 7 17:00:48 EST 2010


Author: david.lloyd at jboss.com
Date: 2010-01-07 17:00:47 -0500 (Thu, 07 Jan 2010)
New Revision: 3916

Modified:
   jboss-stdio/trunk/src/main/java/org/jboss/stdio/StdioContext.java
Log:
Add convenience method

Modified: jboss-stdio/trunk/src/main/java/org/jboss/stdio/StdioContext.java
===================================================================
--- jboss-stdio/trunk/src/main/java/org/jboss/stdio/StdioContext.java	2010-01-07 21:36:21 UTC (rev 3915)
+++ jboss-stdio/trunk/src/main/java/org/jboss/stdio/StdioContext.java	2010-01-07 22:00:47 UTC (rev 3916)
@@ -77,6 +77,19 @@
     }
 
     /**
+     * Create a console I/O context.  The given output streams are wrapped in {@code PrintStream} instances.
+     *
+     * @param in the input stream for this context
+     * @param out the output stream for this context
+     * @param err the error stream for this context
+     * @return the new context
+     * @throws SecurityException if the caller does not have the {@code createStdioContext} {@link RuntimePermission}
+     */
+    public static StdioContext create(final InputStream in, final OutputStream out, final OutputStream err) throws SecurityException {
+        return create(in, new PrintStream(out), new PrintStream(err));
+    }
+
+    /**
      * Get the current console I/O context.
      *
      * @return the current context



More information about the jboss-svn-commits mailing list