Examples of PipedOutputStream


Examples of java.io.PipedOutputStream

            this.pwd = dir;
            this.pipedStreams = pipedStreams;
            if (pipedStreams) {
                processOutput = new PipedInputStream();
                processError = new PipedInputStream();
                processInput = new PipedOutputStream();
            } else {
                processOutput = processError = null;
                processInput = null;
            }
        }
View Full Code Here

Examples of java.io.PipedOutputStream

                setEnvironment(environmentMap(env));
                setCurrentDirectory(pwd.toString());
            }};
            if (pipedStreams) {
                this.config.setInput(new PipedInputStream(processInput));
                this.config.setOutput(new PrintStream(new PipedOutputStream(processOutput)));
                this.config.setError(new PrintStream(new PipedOutputStream(processError)));
            }
            String procName = "piped";
            if (argArray.length > 0) {
                procName = argArray[0];
            }
View Full Code Here

Examples of java.io.PipedOutputStream

    private List<CachedOutputStreamCallback> callbacks;
   
    private List<Object> streamList = new ArrayList<Object>();

    public CachedOutputStream(PipedInputStream stream) throws IOException {
        currentStream = new PipedOutputStream(stream);
        inmem = true;
        readBusProperties();
    }
View Full Code Here

Examples of java.io.PipedOutputStream

                    ByteArrayOutputStream byteOut = (ByteArrayOutputStream) currentStream;
                    if (copyOldContent && byteOut.size() > 0) {
                        byteOut.writeTo(out);
                    }
                } else if (currentStream instanceof PipedOutputStream) {
                    PipedOutputStream pipeOut = (PipedOutputStream) currentStream;
                    IOUtils.copyAndCloseInput(new PipedInputStream(pipeOut), out);
                } else {
                    throw new IOException("Unknown format of currentStream");
                }
            } else {
View Full Code Here

Examples of java.io.PipedOutputStream

    private List<CachedOutputStreamCallback> callbacks;
   
    private List<Object> streamList = new ArrayList<Object>();

    public CachedOutputStream(PipedInputStream stream) throws IOException {
        currentStream = new PipedOutputStream(stream);
        inmem = true;
    }
View Full Code Here

Examples of java.io.PipedOutputStream

                    ByteArrayOutputStream byteOut = (ByteArrayOutputStream) currentStream;
                    if (copyOldContent && byteOut.size() > 0) {
                        byteOut.writeTo(out);
                    }
                } else if (currentStream instanceof PipedOutputStream) {
                    PipedOutputStream pipeOut = (PipedOutputStream) currentStream;
                    IOUtils.copyAndCloseInput(new PipedInputStream(pipeOut), out);
                } else {
                    throw new IOException("Unknown format of currentStream");
                }
            } else {
View Full Code Here

Examples of java.io.PipedOutputStream

    File tarGzFile = new File(path + name + ".tar.gz");

    if(!tarGzFile.exists()) {
      System.out.println("This test is a bit slow. It needs to write 3GB of data as a compressed file (approx. 3MB) to your hard drive");

      final PipedOutputStream outTarFileStream = new PipedOutputStream();
      PipedInputStream inTarFileStream = new PipedInputStream(outTarFileStream);

      Thread source = new Thread(){

        @Override
        public void run() {
            byte ba_1k[] = new byte[(int) _1K];
            for(int i=0; i < ba_1k.length; i++){
                ba_1k[i]='a';
            }
            try {
                TarArchiveOutputStream outTarStream =
                    (TarArchiveOutputStream)new ArchiveStreamFactory()
                    .createArchiveOutputStream(ArchiveStreamFactory.TAR, outTarFileStream);
                // Create archive contents
                TarArchiveEntry tarArchiveEntry = new TarArchiveEntry(name + ".txt");
                tarArchiveEntry.setSize(fileSize);

                outTarStream.putArchiveEntry(tarArchiveEntry);
                for(long i = 0; i < fileSize; i+= ba_1k.length) {
                    outTarStream.write(ba_1k);
                }
                outTarStream.closeArchiveEntry();
                outTarStream.close();
                outTarFileStream.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
View Full Code Here

Examples of java.io.PipedOutputStream

        } else {
            this.replaceRegularExpressions = replaceRegularExpressions;
        }
        this.url = url;
        in = new PipedInputStream();
        out = new PipedOutputStream(in);
    }
View Full Code Here

Examples of java.io.PipedOutputStream

        } else {
            this.replaceRegularExpressions = replaceRegularExpressions;
        }
        this.url = url;
        in = new PipedInputStream();
        out = new PipedOutputStream(in);
    }
View Full Code Here

Examples of java.io.PipedOutputStream

        public XslTransformerStream(InputStream inputXml, String xslHref, URL xmlLocation) throws IOException {
            super();
            this.inputXml = inputXml;
            this.xslHref = xslHref;
            this.transformerThread = null;
            this.pipedOut = new PipedOutputStream(this);
            this.xmlLocation = xmlLocation;
        }
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.