Package java.io

Examples of java.io.PipedInputStream


    private OutputStream pipeOut;

    public MessageBuilder(ServerInfo info, Logger logmon) throws IOException {
      super(name + ".MessageBuilder", logmon);
      this.servInfo = info;
      PipedInputStream is = new PipedInputStream();
      this.pipeIn = new NetworkInputStream(is);
      this.pipeOut = new PipedOutputStream(is);
    }
View Full Code Here


  }
  public void setExtOutputStream(OutputStream out, boolean dontclose){
    io.setExtOutputStream(out, dontclose);
  }
  public InputStream getInputStream() throws IOException {
    PipedInputStream in=
      new MyPipedInputStream(
                             32*1024  // this value should be customizable.
                             );
    io.setOutputStream(new PassiveOutputStream(in), false);
    return in;
View Full Code Here

                             );
    io.setOutputStream(new PassiveOutputStream(in), false);
    return in;
  }
  public InputStream getExtInputStream() throws IOException {
    PipedInputStream in=
      new MyPipedInputStream(
                             32*1024  // this value should be customizable.
                             );
    io.setExtOutputStream(new PassiveOutputStream(in), false);
    return in;
View Full Code Here

   
  {       
    String  get = "/download/" + getURL().toString().substring( 7 ) + " HTTP/1.0" + NL + NL;
   
    PipedOutputStream   pos = new PipedOutputStream();
    PipedInputStream   pis = new PipedInputStream();
   
    pis.connect( pos );
   
    input_stream  = pis;
    output_stream   = pos;
   
    MagnetURIHandler.getSingleton().process( get, new ByteArrayInputStream(new byte[0]), pos );
View Full Code Here

      loader.showError(err);
    }
  }

  public LogisimFile cloneLogisimFile(Loader newloader) {
    PipedInputStream reader = new PipedInputStream();
    PipedOutputStream writer = new PipedOutputStream();
    try {
      reader.connect(writer);
    } catch (IOException e) {
      newloader.showError(StringUtil.format(
        Strings.get("fileDuplicateError"), e.toString()));
      return null;
    }
View Full Code Here

        test(true);
        test(false);
    }

    private void test(final boolean commandLineArgs) throws IOException {
        testIn = new PipedInputStream();
        PipedOutputStream out = new PipedOutputStream(testIn);
        toolOut = new PrintStream(out, true);
        out = new PipedOutputStream();
        testOut = new PrintStream(out, true);
        toolIn = new PipedInputStream(out);
        Task task = new Task() {
            public void call() throws Exception {
                try {
                    Shell shell = new Shell();
                    shell.setIn(toolIn);
View Full Code Here

            }
            final JdbcConnection c = conn;
            // PipedReader / PipedWriter are a lot slower
            // than PipedInputStream / PipedOutputStream
            // (Sun/Oracle Java 1.6.0_20)
            final PipedInputStream in = new PipedInputStream();
            final Task task = new Task() {
                public void call() {
                    value = c.createClob(IOUtils.getReader(in), -1);
                }
            };
View Full Code Here

    public PipeURLConnection(URL url) {
        super(url);
    }

    public void connect() throws IOException {
        PipedInputStream pin = new BiggerPipeInputStream();
        pout = new PipedOutputStream(pin);
        response = PipeServer.startDispatch(url, this, pin, requestHeaders);
        connected = true;
    }
View Full Code Here

        return reqIn;
    }
   
    public OutputStream setResponse(Map<String, List<String>> h) throws IOException {
        synchronized (this) {
            PipedInputStream pin = new BiggerPipeInputStream();
            pout = new PipedOutputStream(pin);
            headers = h;
            in = pin;
            notifyAll();
            return pout;
View Full Code Here

               ps.setString(1, "someName");
               byte[] blob = new byte[4096];
               int sweeps = 10240; // 40 MB

               int length = blob.length * sweeps;
               PipedInputStream pi = new PipedInputStream();
               PipedOutputStream po = new PipedOutputStream(pi);
               ps.setBinaryStream(2, pi, length);

               Pusher pusher = new Pusher(sweeps, blob, po);
               pusher.start();
View Full Code Here

TOP

Related Classes of java.io.PipedInputStream

Copyright © 2018 www.massapicom. 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.