public class StreamPipe
extends java.lang.Object
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 and Description |
---|
StreamPipe()
Create synchronous stream conector.
|
StreamPipe(boolean bSync)
Create synchronous or asynchronous stream conector.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public StreamPipe()
public StreamPipe(boolean bSync)
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 streamjava.io.IOException
public void between(java.io.InputStream in, java.io.OutputStream out, int bufferSize) throws java.io.IOException
in
- input streamout
- output streamjava.io.IOException
public void between(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
in
- input streamout
- output streamjava.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 streamjava.io.IOException
java.io.FileNotFoundException