public class IO extends Object
| Constructor and Description |
|---|
IO() |
| Modifier and Type | Method and Description |
|---|---|
static void |
close(Closeable c)
Close given InputStream, ignoring any resulting exception.
|
static void |
close(InputStream inputStream)
Close given InputStream, ignoring any resulting exception.
|
static void |
close(OutputStream outputStream)
Close given OutputStream, ignoring any resulting exception.
|
static long |
copy(InputStream in,
OutputStream out) |
static long |
copy(InputStream in,
OutputStream out,
long maxBytes) |
static long |
copy(Reader in,
Writer out) |
static long |
copy(Reader in,
Writer out,
long maxChars) |
static byte[] |
readAll(InputStream in) |
static byte[] |
readAll(InputStream in,
int size) |
static String |
readAll(Reader reader) |
static void |
skipFully(InputStream in,
long bytes)
Provide a skip fully method.
|
static boolean |
verifyURL(URL u) |
public static byte[] readAll(@WillClose InputStream in) throws IOException
IOExceptionpublic static byte[] readAll(@WillClose InputStream in, int size) throws IOException
IOExceptionpublic static String readAll(Reader reader) throws IOException
IOExceptionpublic static long copy(@WillNotClose InputStream in, @WillNotClose OutputStream out) throws IOException
IOExceptionpublic static long copy(Reader in, Writer out) throws IOException
IOExceptionpublic static long copy(@WillNotClose InputStream in, @WillNotClose OutputStream out, long maxBytes) throws IOException
IOExceptionpublic static long copy(Reader in, Writer out, long maxChars) throws IOException
IOExceptionpublic static void close(@CheckForNull Closeable c)
public static void close(@CheckForNull InputStream inputStream)
inputStream - the InputStream to close; may be null (in which case nothing
happens)public static void close(@CheckForNull OutputStream outputStream)
outputStream - the OutputStream to close; may be null (in which case nothing
happens)public static void skipFully(InputStream in, long bytes) throws IOException
in - The input stream on which to perform the skipbytes - Number of bytes to skipEOFException - if we reach EOF and still need to skip more bytesIOException - if in.skip throws an IOExceptionpublic static boolean verifyURL(URL u)
Copyright © 2003–2015. All rights reserved.