|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.knowgate.dfs.StreamPipe
public class StreamPipe
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.
| Constructor Summary | |
|---|---|
StreamPipe()
Create synchronous stream conector. |
|
StreamPipe(boolean bSync)
Create synchronous or asynchronous stream conector. |
|
| Method Summary | |
|---|---|
void |
between(java.io.InputStream in,
java.io.OutputStream out)
Establish connection between input and output streams with default buffer size and no auto-flush. |
void |
between(java.io.InputStream in,
java.io.OutputStream out,
int bufferSize)
Establish connection between input and output streams with specified size of buffer used for data transfer and no auto-flush. |
void |
between(java.io.InputStream in,
java.io.OutputStream out,
int bufferSize,
boolean autoFlush)
Establish connection between input and output streams with specified size of buffer used for data transfer. |
static void |
between(java.lang.String sFilePath,
java.io.OutputStream oOutStrm)
Establish synchronous connection between a file and an output stream with specified size of buffer used for data transfer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamPipe()
public StreamPipe(boolean bSync)
| Method Detail |
|---|
public void between(java.io.InputStream in,
java.io.OutputStream out,
int bufferSize,
boolean autoFlush)
throws java.io.IOException
in - input streamout - output streambufferSize - size of buffer used to transfer data from the input stream to the output streamautoFlush - if set to true OutputStream.flush() method will be called each time bufferSize bytes are written into output stream
java.io.IOException
public void between(java.io.InputStream in,
java.io.OutputStream out,
int bufferSize)
throws java.io.IOException
in - input streamout - output stream
java.io.IOException
public void between(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
in - input streamout - output stream
java.io.IOException
public static void between(java.lang.String sFilePath,
java.io.OutputStream oOutStrm)
throws java.io.IOException,
java.io.FileNotFoundException
sFilePath - input streamoOutStrm - output stream
java.io.IOException
java.io.FileNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||