|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.utils.StreamCopier
This utility class copies all data from an InputStream to an OutputStream.
Constructor Summary | |
StreamCopier(InputStream inStream,
boolean closeIn,
OutputStream outStream,
boolean closeOut)
Creates a StreamCopier that reads from inStream and writes to outStream. |
|
StreamCopier(InputStream inStream,
OutputStream outStream)
Creates a StreamCopier that reads from inStream and writes to outStream. |
Method Summary | |
void |
copyStream()
Start the copying. |
IOException |
getException()
Get the IOException that occured during copying (if any). |
boolean |
isActive()
Check whether the copier is already finished. |
void |
run()
Run method to allow the StreamCopier to be run in a separate Thread easily. |
void |
setCloseIn(boolean closeIn)
Set whether the InputStream shall be closed after copying. |
void |
setCloseOut(boolean closeOut)
Set whether the OutputStream shall be closed after copying. |
void |
waitFinished()
Wait for the StreamCopier to finish. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StreamCopier(InputStream inStream, OutputStream outStream)
public StreamCopier(InputStream inStream, boolean closeIn, OutputStream outStream, boolean closeOut)
Method Detail |
public void setCloseIn(boolean closeIn)
public void setCloseOut(boolean closeOut)
public boolean isActive()
public void copyStream() throws IOException
read()
returns -1) or until an Exception occurs.
If an IOException occurs, this method will still continue and close
the stream, etc., but the Exception will be remembered and thrown
at the end of the method (only EOFExceptions are not thrown, as they may
occur in normal operations). If a Thread is waiting for the copy to
finish (see waitFinished()
) it will be awaken when
copying is done.public void waitFinished()
public void run()
copyStream()
and ignores
Exceptions.run
in interface Runnable
public IOException getException()
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |