public class StreamPipe extends 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 connector.
between() methods do not return until end of input stream is reached and
written into output stream.
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
between(InputStream in,
OutputStream out)
Establish connection between input and output streams with default buffer size and no auto-flush.
|
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.
|
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.
|
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.
|
public StreamPipe()
public StreamPipe(boolean bSync)
bSync - booleanpublic void between(InputStream in, OutputStream out, int bufferSize, boolean autoFlush) throws IOException
in - input streamout - output streambufferSize - int 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 streamIOExceptionpublic void between(InputStream in, OutputStream out, int bufferSize) throws IOException
in - input streamout - output streambufferSize - int size of buffer used to transfer data from the input stream to the output streamIOExceptionpublic void between(InputStream in, OutputStream out) throws IOException
in - input streamout - output streamIOExceptionpublic static void between(String sFilePath, OutputStream oOutStrm) throws IOException, FileNotFoundException
sFilePath - input streamoOutStrm - output streamIOExceptionFileNotFoundExceptionCopyright © 2001–2019 KnowGate. All rights reserved.