package org.jboss.aesh.console.reader;

import java.io.BufferedInputStream;

/**
 * Pipes the standard input and standard error
 * to the current running command
 *
 * @author <a href="mailto:stale.pedersen@jboss.org">Ståle W. Pedersen</a>
 */
public class AeshStandardStream {

    private BufferedInputStream stdIn;
    private BufferedInputStream stdError;

    public AeshStandardStream() {
    }

    public AeshStandardStream(BufferedInputStream stdIn) {
        this.stdIn = stdIn;
    }

    public AeshStandardStream(BufferedInputStream stdIn, BufferedInputStream stdError) {
        this.stdIn = stdIn;
        this.stdError = stdError;
    }

    public BufferedInputStream getStdIn() {
        return stdIn;
    }

    public void setStdIn(BufferedInputStream stdIn) {
        this.stdIn = stdIn;
    }

    public BufferedInputStream getStdError() {
        return stdError;
    }

    public void setStdError(BufferedInputStream stdError) {
        this.stdError = stdError;
    }
}

@@ -384,24 +384,121 @@
 dStream() %7B%0A
+        stdIn = new BufferedInputStream(null);%0A        stdError = new BufferedInputStream(null);%0A
     %7D%0A%0A    p
@@ -571,32 +571,82 @@
 .stdIn = stdIn;%0A
+        stdError = new BufferedInputStream(null);%0A
     %7D%0A%0A    publi

make sure neither stdin/stderr is ever null