|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tuscany.sca.contribution.service.util.IOHelper
public class IOHelper
Nested Class Summary | |
---|---|
static class |
IOHelper.SafeURLInputStream
This class is a workaround for URL stream issue as illustrated below. |
Constructor Summary | |
---|---|
IOHelper()
|
Method Summary | |
---|---|
static void |
closeQuietly(java.io.InputStream input)
Unconditionally close an InputStream . |
static void |
closeQuietly(java.io.OutputStream output)
Unconditionally close an OutputStream . |
static int |
copy(java.io.InputStream input,
java.io.OutputStream output)
Copy bytes from an InputStream to an
OutputStream . |
static java.io.InputStream |
getInputStream(java.net.URL url)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IOHelper()
Method Detail |
---|
public static void closeQuietly(java.io.InputStream input)
InputStream
.
Equivalent to IOHelper.SafeURLInputStream.close()
, except any exceptions will be ignored.
This is typically used in finally blocks.
input
- the InputStream to close, may be null or already closedpublic static void closeQuietly(java.io.OutputStream output)
OutputStream
.
Equivalent to OutputStream.close()
, except any exceptions will be ignored.
This is typically used in finally blocks.
output
- the OutputStream to close, may be null or already closedpublic static int copy(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
InputStream
to an
OutputStream
.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
input
- the InputStream
to read fromoutput
- the OutputStream
to write to
java.lang.NullPointerException
- if the input or output is null
java.io.IOException
- if an I/O error occurspublic static java.io.InputStream getInputStream(java.net.URL url) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |