public final class FileUtilities extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(InputStream in,
OutputStream out)
Copy everything from an InputStream to an OutputStream.
|
static void |
copy(Reader reader,
Writer writer)
Copy everything from a Reader to a Writer.
|
static byte[] |
load(InputStream in)
Returns the contents of an InputStream in a byte array.
|
static String |
load(InputStream in,
String encoding)
Returns the contents of an InputStream in a String.
|
static String |
load(Reader reader)
Returns the contents of a reader in a String.
|
public static void copy(InputStream in, OutputStream out) throws IOException
in - the InputStreamout - the OutputStreamIOException - if an i/o error occurspublic static byte[] load(InputStream in) throws IOException
in - the InputStreamIOException - if an i/o erro occurspublic static void copy(Reader reader, Writer writer) throws IOException
reader - the Readerwriter - the WriterIOException - if an i/o error occurspublic static String load(Reader reader) throws IOException
reader - the ReaderIOException - if an i/o erro occurspublic static String load(InputStream in, String encoding) throws IOException
in - the InputStreamencoding - the encoding of the streamIOException - if an i/o error occursCopyright © 2014–2016 Tomas Teubner. All rights reserved.