public class IOUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(InputStream in)
Closes an input stream and quietly ignores any exception.
|
static void |
closeQuietly(OutputStream out)
Closes an output stream and quietly ignores any exception.
|
static void |
closeQuietly(Reader in)
Closes an input stream and quietly ignores any exception.
|
static void |
closeQuietly(Writer out)
Closes an output stream and quietly ignores any exception.
|
static URL |
getResource(ClassLoader classLoader,
String resource)
Finds a resource on the classpath.
|
static InputStream |
getResourceAsStream(String resource)
Loads a resource from the classpath.
|
public static void closeQuietly(Reader in)
in - the stream to closepublic static void closeQuietly(Writer out)
out - the stream to closepublic static void closeQuietly(InputStream in)
in - the stream to closepublic static void closeQuietly(OutputStream out)
out - the stream to closepublic static URL getResource(ClassLoader classLoader, String resource)
resource - the name of the resource to loadpublic static InputStream getResourceAsStream(String resource) throws IOException
resource - the name of the resource to loadInputStream to read the resource or null if the
resource was not foundIOException - if an I/O error occurs