public class IOUtils extends Object
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyAndClose(InputStream in,
OutputStream out)
Copies the input stream to the output stream and closes both streams.
|
static String |
toStringAndClose(InputStream in)
Reads and closes the input stream, converting it to a String using the UTF-8 charset.
|
public static void copyAndClose(InputStream in, OutputStream out) throws IOException
in - InputStream to read and closeout - OutputStream to read and closeIOException - if an error occurs reading or writing to/from the streamspublic static String toStringAndClose(InputStream in) throws IOException
in - UTF-8-encoded InputStream to readIOException - if an error occurs reading from the streamCopyright © 2015. All Rights Reserved.