--- old/src/java.base/share/classes/java/lang/Process.java 2015-04-14 15:58:55.371617535 +0200 +++ new/src/java.base/share/classes/java/lang/Process.java 2015-04-14 15:58:55.313617397 +0200 @@ -27,6 +27,7 @@ import java.io.*; import java.lang.ProcessBuilder.Redirect; +import java.nio.channels.Pipe; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.stream.Stream; @@ -151,6 +152,75 @@ public abstract InputStream getErrorStream(); /** + * Returns the output channel connected to the normal input of the + * subprocess if and only if it has been redirected using + * {@link ProcessBuilder#redirectInput ProcessBuilder.redirectInput}( + * {@link Redirect#PIPE_CHANNEL} + * ). + * It returns {@code null} otherwise. + *

Output to the channel is piped into the standard + * input of the process represented by this {@code Process} object + *

It is the user's responsibility to obtain the output channel and + * close it if {@code PIPE_CHANNEL} redirection has been used. + * + * @return the output channel connected to the normal input of the + * subprocess if redirected to {@code PIPE_CHANNEL} or null otherwise + * @since 1.9 + */ + public Pipe.SinkChannel getOutputChannel() { + return null; + } + + /** + * Returns the input channel connected to the normal output of the + * subprocess if and only if it has been redirected using + * {@link ProcessBuilder#redirectOutput ProcessBuilder.redirectOutput}( + * {@link Redirect#PIPE_CHANNEL} + * ). + * It returns {@code null} otherwise. + *

The channel obtains data piped from the standard + * output of the process represented by this {@code Process} object. + *

It is the user's responsibility to obtain the input channel and + * close it if {@code PIPE_CHANNEL} redirection has been used. + *

If the standard error of the subprocess has been + * redirected using + * {@link ProcessBuilder#redirectErrorStream(boolean) + * ProcessBuilder.redirectErrorStream} + * then the input channel returned by this method will receive the + * merged standard output and the standard error of the subprocess. + * + * @return the input channel connected to the normal output of the + * subprocess if redirected from {@code PIPE_CHANNEL} or + * null otherwise + * @since 1.9 + */ + public Pipe.SourceChannel getInputChannel() { + return null; + } + + /** + * Returns the input channel connected to the error output of the + * subprocess if and only if it has been redirected using + * {@link ProcessBuilder#redirectError ProcessBuilder.redirectError}( + * {@link Redirect#PIPE_CHANNEL} + * ) and has not been redirected using + * {@link ProcessBuilder#redirectErrorStream(boolean) + * ProcessBuilder.redirectErrorStream}. It returns {@code null} otherwise. + *

The channel obtains data piped from the error + * output of the process represented by this {@code Process} object. + *

It is the user's responsibility to obtain the error channel and + * close it if {@code PIPE_CHANNEL} redirection has been used. + * + * @return the input channel connected to the error output of the + * subprocess if redirected from {@code PIPE_CHANNEL} or + * null otherwise + * @since 1.9 + */ + public Pipe.SourceChannel getErrorChannel() { + return null; + } + + /** * Causes the current thread to wait, if necessary, until the * process represented by this {@code Process} object has * terminated. This method returns immediately if the subprocess