| java.lang.Object com.knowgate.dfs.StreamPipe
StreamPipe | public class StreamPipe (Code) | | This class links input and output streams so that data taken from input
stream is transfered to the output stream. This class can be used to
connect standard input/ouput stream of Java application with
output/input streams of spawned child process, so that all user's input is
redirected to the child and all it's output is visible for the user.
This class starts a thread, which transfers data from input stream to
output stream until End Of File is reached or IOException caused by IO
error is catched.
author: Konstantin Knizhnik version: 1.04 |
Constructor Summary | |
public | StreamPipe() Create synchronous stream conector.
between() methods do not return until end of input stream is reached and
written into ouput stream. | public | StreamPipe(boolean bSync) Create synchronous or asynchronous stream conector.
between() methods do not return until end of input stream is reached and
written into ouput stream. |
Method Summary | |
public void | between(InputStream in, OutputStream out, int bufferSize, boolean autoFlush) Establish connection between input and output streams with specified size of buffer used for data transfer. | public void | between(InputStream in, OutputStream out, int bufferSize) Establish connection between input and output streams with specified size of buffer used for data transfer and no auto-flush. | public void | between(InputStream in, OutputStream out) Establish connection between input and output streams with default buffer size and no auto-flush. | public static void | between(String sFilePath, OutputStream oOutStrm) Establish synchronous connection between a file and an output stream
with specified size of buffer used for data transfer. |
bSynchronous | boolean bSynchronous(Code) | | |
StreamPipe | public StreamPipe()(Code) | | Create synchronous stream conector.
between() methods do not return until end of input stream is reached and
written into ouput stream.
|
StreamPipe | public StreamPipe(boolean bSync)(Code) | | Create synchronous or asynchronous stream conector.
between() methods do not return until end of input stream is reached and
written into ouput stream.
|
between | public void between(InputStream in, OutputStream out, int bufferSize, boolean autoFlush) throws IOException(Code) | | Establish connection between input and output streams with specified size of buffer used for data transfer.
Parameters: in - input stream Parameters: out - output stream Parameters: bufferSize - size of buffer used to transfer data from the input stream to the output stream Parameters: autoFlush - if set to true OutputStream.flush() method will be called each time bufferSize bytes are written into output stream |
between | public void between(InputStream in, OutputStream out, int bufferSize) throws IOException(Code) | | Establish connection between input and output streams with specified size of buffer used for data transfer and no auto-flush.
Parameters: in - input stream Parameters: out - output stream |
between | public void between(InputStream in, OutputStream out) throws IOException(Code) | | Establish connection between input and output streams with default buffer size and no auto-flush.
Parameters: in - input stream Parameters: out - output stream |
between | public static void between(String sFilePath, OutputStream oOutStrm) throws IOException, FileNotFoundException(Code) | | Establish synchronous connection between a file and an output stream
with specified size of buffer used for data transfer.
autoFlush is set to false and buffer size is set to 8000 bytes.
Parameters: sFilePath - input stream Parameters: oOutStrm - output stream since: 3.0 |
|
|