## org.apache.tools.ant.taskdefs
Class PumpStreamHandler

    java.lang.Object
      |
      +--org.apache.tools.ant.taskdefs.PumpStreamHandler

All Implemented Interfaces:
  ExecuteStreamHandler

Direct Known Subclasses:
  LogStreamHandler

public class PumpStreamHandler
extends java.lang.Object
implements ExecuteStreamHandler

Copies standard output and error of subprocesses to standard output and error of the parent process. TODO: standard input of the subprocess is not implemented.

Since:
  Ant 1.2
Author:
  thomas.haas@softwired-inc.com

Constructor Summary
`PumpStreamHandler()`
`PumpStreamHandler(java.io.OutputStream outAndErr)`
`PumpStreamHandler(java.io.OutputStream out, java.io.OutputStream err)`
`PumpStreamHandler(java.io.OutputStream out, java.io.OutputStream err, java.io.InputStream input)`

Method Summary
`protected void` `createProcessErrorPump(java.io.InputStream is, java.io.OutputStream os)`
`protected void` `createProcessOutputPump(java.io.InputStream is, java.io.OutputStream os)`
`protected java.lang.Thread` `createPump(java.io.InputStream is, java.io.OutputStream os)` Creates a stream pumper to copy the given input stream to the given output stream.
`protected java.lang.Thread` `createPump(java.io.InputStream is, java.io.OutputStream os, boolean closeWhenExhausted)` Creates a stream pumper to copy the given input stream to the given output stream.
`protected java.io.OutputStream` `getErr()`
`protected java.io.OutputStream` `getOut()`
`void` `setProcessErrorStream(java.io.InputStream is)` Install a handler for the error stream of the subprocess.
`void` `setProcessInputStream(java.io.OutputStream os)` Install a handler for the input stream of the subprocess.
`void` `setProcessOutputStream(java.io.InputStream is)` Install a handler for the output stream of the subprocess.
`void` `start()` Start handling of the streams.
`void` `stop()` Stop handling of the streams - will not be restarted.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PumpStreamHandler

    public PumpStreamHandler(java.io.OutputStream out,
                             java.io.OutputStream err,
                             java.io.InputStream input)

### PumpStreamHandler

    public PumpStreamHandler(java.io.OutputStream out,
                             java.io.OutputStream err)

### PumpStreamHandler

    public PumpStreamHandler(java.io.OutputStream outAndErr)

### PumpStreamHandler

    public PumpStreamHandler()

Method Detail

### setProcessOutputStream

    public void setProcessOutputStream(java.io.InputStream is)

  Description copied from interface: `ExecuteStreamHandler`
  Install a handler for the output stream of the subprocess.

  Specified by:
    `setProcessOutputStream` in interface `ExecuteStreamHandler`
  Parameters:
    `is` - input stream to read from the error stream from the subprocess

### setProcessErrorStream

    public void setProcessErrorStream(java.io.InputStream is)

  Description copied from interface: `ExecuteStreamHandler`
  Install a handler for the error stream of the subprocess.

  Specified by:
    `setProcessErrorStream` in interface `ExecuteStreamHandler`
  Parameters:
    `is` - input stream to read from the error stream from the subprocess

### setProcessInputStream

    public void setProcessInputStream(java.io.OutputStream os)

  Description copied from interface: `ExecuteStreamHandler`
  Install a handler for the input stream of the subprocess.

  Specified by:
    `setProcessInputStream` in interface `ExecuteStreamHandler`
  Parameters:
    `os` - output stream to write to the standard input stream of the subprocess

### start

    public void start()

  Description copied from interface: `ExecuteStreamHandler`
  Start handling of the streams.

  Specified by:
    `start` in interface `ExecuteStreamHandler`

### stop

    public void stop()

  Description copied from interface: `ExecuteStreamHandler`
  Stop handling of the streams - will not be restarted.

  Specified by:
    `stop` in interface `ExecuteStreamHandler`

### getErr

    protected java.io.OutputStream getErr()

### getOut

    protected java.io.OutputStream getOut()

### createProcessOutputPump

    protected void createProcessOutputPump(java.io.InputStream is,
                                           java.io.OutputStream os)

### createProcessErrorPump

    protected void createProcessErrorPump(java.io.InputStream is,
                                          java.io.OutputStream os)

### createPump

    protected java.lang.Thread createPump(java.io.InputStream is,
                                          java.io.OutputStream os)

  Creates a stream pumper to copy the given input stream to the given output stream.

### createPump

    protected java.lang.Thread createPump(java.io.InputStream is,
                                          java.io.OutputStream os,
                                          boolean closeWhenExhausted)

  Creates a stream pumper to copy the given input stream to the given output stream.

Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.