| java.lang.Object org.apache.tools.ant.taskdefs.StreamPumper
StreamPumper | public class StreamPumper implements Runnable(Code) | | Copies all data from an input stream to an output stream.
since: Ant 1.2 |
Method Summary | |
public synchronized int | getBufferSize() Get the size in bytes of the read buffer. | public synchronized Exception | getException() Get the exception encountered, if any. | public boolean | isFinished() Tells whether the end of the stream has been reached. | public void | run() Copies data from the input stream to the output stream. | void | setAutoflush(boolean autoflush) Set whether data should be flushed through to the output stream. | public synchronized void | setBufferSize(int bufferSize) Set the size in bytes of the read buffer. | synchronized void | stop() Stop the pumper as soon as possible. | public synchronized void | waitFor() This method blocks until the stream pumper finishes. |
StreamPumper | public StreamPumper(InputStream is, OutputStream os, boolean closeWhenExhausted)(Code) | | Create a new stream pumper.
Parameters: is - input stream to read data from Parameters: os - output stream to write data to. Parameters: closeWhenExhausted - if true, the output stream will be closed whenthe input is exhausted. |
StreamPumper | public StreamPumper(InputStream is, OutputStream os)(Code) | | Create a new stream pumper.
Parameters: is - input stream to read data from Parameters: os - output stream to write data to. |
getBufferSize | public synchronized int getBufferSize()(Code) | | Get the size in bytes of the read buffer.
the int size of the read buffer. |
getException | public synchronized Exception getException()(Code) | | Get the exception encountered, if any.
the Exception encountered. |
isFinished | public boolean isFinished()(Code) | | Tells whether the end of the stream has been reached.
true is the stream has been exhausted. |
run | public void run()(Code) | | Copies data from the input stream to the output stream.
Terminates as soon as the input stream is closed or an error occurs.
|
setAutoflush | void setAutoflush(boolean autoflush)(Code) | | Set whether data should be flushed through to the output stream.
Parameters: autoflush - if true, push through data; if false, let it be buffered since: Ant 1.6.3 |
setBufferSize | public synchronized void setBufferSize(int bufferSize)(Code) | | Set the size in bytes of the read buffer.
Parameters: bufferSize - the buffer size to use. throws: IllegalStateException - if the StreamPumper is already running. |
stop | synchronized void stop()(Code) | | Stop the pumper as soon as possible.
Note that it may continue to block on the input stream
but it will really stop the thread as soon as it gets EOF
or any byte, and it will be marked as finished.
since: Ant 1.6.3 |
|
|