public final class IO extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(Closeable c)
Closes given object quietly.
|
static void |
copy(InputStream input,
OutputStream output) |
static String |
readFully(Reader reader)
Reads all characters from given reader and returns them as a string.
|
static byte[] |
toByteArray(InputStream inputStream) |
static File |
toFile(URL url)
Convert from an
URL to a File object. |
public static void closeQuietly(Closeable c)
c - the object to close.public static String readFully(Reader reader) throws IOException
reader - the reader to read, must not be null.null.IOExceptionpublic static File toFile(URL url)
URL to a File object. Performs decoding of the URL:
syntax such as file:///my%20docs/file.txt will be
correctly decoded to /my docs/file.txt.url - the file URL to convert, null returns nullFile object, or null
if the URL's protocol is not fileIllegalArgumentException - if the file is incorrectly encodedpublic static byte[] toByteArray(InputStream inputStream) throws IOException
IOExceptionpublic static void copy(InputStream input, OutputStream output) throws IOException
IOExceptionCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.