Examples of TeeOutputStream


Examples of org.apache.tools.ant.util.TeeOutputStream

                managingTask.log("Output redirected to property: "
                    + outputProperty, Project.MSG_VERBOSE);
                if (out == null) {
                    outputStream = baos;
                } else {
                    outputStream = new TeeOutputStream(outputStream, baos);
                }
            } else {
                baos = null;
            }

            errorStream = outputStream;
        }

        if (logError) {
            errorStream = new LogOutputStream(managingTask, Project.MSG_WARN);
        }

        if (error != null)  {
            errorStream = new LazyFileOutputStream(error, append);
            managingTask.log("Error redirected to " + error,
                             Project.MSG_VERBOSE);
        }

        if (errorProperty != null) {
            errorBaos = new ByteArrayOutputStream();
            managingTask.log("Error redirected to property: " + errorProperty,
                Project.MSG_VERBOSE);
            if (error == null) {
                errorStream = errorBaos;
            } else {
                errorStream = new TeeOutputStream(errorStream, errorBaos);
            }
        } else {
            errorBaos = null;
        }
View Full Code Here

Examples of org.apache.tools.ant.util.TeeOutputStream

                if ("out".equalsIgnoreCase(args[0])) {
                    os = System.out;
                } else if ("err".equalsIgnoreCase(args[0])) {
                    os = System.err;
                } else if ("both".equalsIgnoreCase(args[0])) {
                    os = new TeeOutputStream(System.out, System.err);
                }
            }
            if (os != null) {
                Thread t = new Thread(new StreamPumper(System.in, os, true));
                t.setName("PipeEntryPoint " + args[0]);
View Full Code Here

Examples of org.apache.tools.ant.util.TeeOutputStream

    private void executeCommand(Session session, String cmd, StringBuffer sb)
        throws BuildException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ByteArrayOutputStream errout = new ByteArrayOutputStream();
        OutputStream teeErr = suppressSystemErr ? errout : new TeeOutputStream(errout, KeepAliveOutputStream.wrapSystemErr());
        OutputStream tee = suppressSystemOut ? out : new TeeOutputStream(out, KeepAliveOutputStream.wrapSystemOut());

        InputStream istream = null ;
        if (inputFile != null) {
            try {
                istream = new FileInputStream(inputFile) ;
View Full Code Here

Examples of org.apache.tools.ant.util.TeeOutputStream

                }
            });
    }

    private PrintStream createTeePrint(PrintStream ps1, PrintStream ps2) {
        return new PrintStream(new TeeOutputStream(ps1, ps2));
    }
View Full Code Here

Examples of org.apache.tools.ant.util.TeeOutputStream

            outStreams();
            if (alwaysLogOut || outputStream == null) {
                OutputStream outputLog = new LogOutputStream(managingTask,
                        Project.MSG_INFO);
                outputStream = (outputStream == null) ? outputLog
                        : new TeeOutputStream(outputLog, outputStream);
            }

            if ((outputFilterChains != null && outputFilterChains.size() > 0)
                    || !(outputEncoding.equalsIgnoreCase(inputEncoding))) {
                try {
                    LeadPipeInputStream snk = new LeadPipeInputStream();
                    snk.setManagingComponent(managingTask);

                    InputStream outPumpIn = snk;

                    Reader reader = new InputStreamReader(outPumpIn,
                            inputEncoding);

                    if (outputFilterChains != null
                            && outputFilterChains.size() > 0) {
                        ChainReaderHelper helper = new ChainReaderHelper();
                        helper.setProject(managingTask.getProject());
                        helper.setPrimaryReader(reader);
                        helper.setFilterChains(outputFilterChains);
                        reader = helper.getAssembledReader();
                    }
                    outPumpIn = new ReaderInputStream(reader, outputEncoding);

                    Thread t = new Thread(threadGroup, new StreamPumper(
                            outPumpIn, outputStream, true), "output pumper");
                    t.setPriority(Thread.MAX_PRIORITY);
                    outputStream = new PipedOutputStream(snk);
                    t.start();
                } catch (IOException eyeOhEx) {
                    throw new BuildException("error setting up output stream",
                            eyeOhEx);
                }
            }
        }

        synchronized (errMutex) {
            errorStreams();
            if (alwaysLogErr || errorStream == null) {
                OutputStream errorLog = new LogOutputStream(managingTask,
                        Project.MSG_WARN);
                errorStream = (errorStream == null) ? errorLog
                        : new TeeOutputStream(errorLog, errorStream);
            }

            if ((errorFilterChains != null && errorFilterChains.size() > 0)
                    || !(errorEncoding.equalsIgnoreCase(inputEncoding))) {
                try {
View Full Code Here

Examples of org.apache.tools.ant.util.TeeOutputStream

                        + outputProperty, Project.MSG_VERBOSE);
            }
            // shield it from being closed by a filtering StreamPumper
            OutputStream keepAliveOutput = new KeepAliveOutputStream(baos);
            outputStream = (outputStream == null) ? keepAliveOutput
                    : new TeeOutputStream(outputStream, keepAliveOutput);
        } else {
            baos = null;
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.util.TeeOutputStream

                        + errorProperty, Project.MSG_VERBOSE);
            }
            // shield it from being closed by a filtering StreamPumper
            OutputStream keepAliveError = new KeepAliveOutputStream(errorBaos);
            errorStream = (error == null || error.length == 0) ? keepAliveError
                    : new TeeOutputStream(errorStream, keepAliveError);
        } else {
            errorBaos = null;
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.util.TeeOutputStream

        char[] c = new char[logHead.length()];
        Arrays.fill(c, ' ');
        String indent = new String(c);

        for (int i = 1; i < file.length; i++) {
            outputStream = new TeeOutputStream(outputStream,
                    new LazyFileOutputStream(file[i], append, createEmptyFiles));
            managingTask.log(indent + file[i], loglevel);
        }
        return result;
    }
View Full Code Here

Examples of org.bouncycastle.util.io.TeeOutputStream

        for (int i = 0; i != passKey.length; i++)
        {
            passKey[i] = 0;
        }

        saveStore(new TeeOutputStream(dOut, mOut));

        byte[]  mac = new byte[hMac.getMacSize()];

        hMac.doFinal(mac, 0);
View Full Code Here

Examples of org.bouncycastle.util.io.TeeOutputStream

            cipher = this.makePBECipher(STORE_CIPHER, Cipher.ENCRYPT_MODE, password, salt, iterationCount);
   
            CipherOutputStream  cOut = new CipherOutputStream(dOut, cipher);
            DigestOutputStream  dgOut = new DigestOutputStream(new SHA1Digest());
   
            this.saveStore(new TeeOutputStream(cOut, dgOut));
   
            byte[]  dig = dgOut.getDigest();

            cOut.write(dig);
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.