public final class UtilIO extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE
Reading buffer size.
|
protected static ICache<URL,byte[]> |
cache
Cache of resources.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getBytes(InputStream in) |
static byte[] |
getBytes(Reader in,
Charset charset) |
static InputStream[] |
getInputStreams(List<URL> files)
Get all input streams for the given URL list.
|
static Reader |
getReader(URI uri)
Get Reader for a given URI.
|
static Reader |
getReader(URL url)
Get Reader for a given URL.
|
static InputStream |
getStream(URI uri)
Get stream for a given URI.
|
static InputStream |
getStream(URL url)
Get stream for a given URL.
|
static String |
getString(Reader in) |
static void |
pressKey()
Request for key interaction.
|
static String |
readFile(File file) |
static List<String> |
readLines(String filename)
Read uncommented not empty lines from files.
|
static void |
writeAllTo(List<URL> files,
OutputStream out)
Write all contents to a output.
|
static void |
writeTo(InputStream in,
OutputStream out)
Write a input stream to a output.
|
static void |
writeTo(Reader in,
Writer out)
Write a reader to a writer.
|
static void |
writeToClose(URL url,
File file)
Write the URL input to the file output.
|
protected static ICache<URL,byte[]> cache
public static final int BUFFER_SIZE
public static List<String> readLines(String filename) throws ResourceException
filename - A file name.ResourceException - On load errors.public static void writeAllTo(List<URL> files, OutputStream out) throws ResourceException
files - The input list.out - The output.ResourceException - On writing errors.public static InputStream[] getInputStreams(List<URL> files) throws ResourceException
files - The files.ResourceException - On loading errors.public static InputStream getStream(URI uri) throws IOException
uri - An uri.IOException - On load errors.public static InputStream getStream(URL url) throws IOException
url - An url.IOException - On load errors.public static Reader getReader(URI uri) throws IOException
uri - An uri.IOException - On load errors.public static Reader getReader(URL url) throws IOException
url - An url.IOException - On load errors.public static void writeTo(InputStream in, OutputStream out) throws IOException
in - The input.out - The output.IOException - On writing errors.public static void writeTo(Reader in, Writer out) throws IOException
in - The input.out - The output.IOException - On writing errors.public static void writeToClose(URL url, File file) throws IOException
url - The input.file - The output.IOException - On writing errors.public static void pressKey()
throws IOException
IOException - On errors.public static String readFile(File file) throws IOException
IOExceptionpublic static String getString(Reader in) throws IOException
IOExceptionpublic static byte[] getBytes(Reader in, Charset charset) throws IOException
IOExceptionpublic static byte[] getBytes(InputStream in) throws IOException
IOExceptionCopyright © 2016. All rights reserved.