|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.inria.ns.reflex.util.io.IOHelper
public final class IOHelper
A set of constants and static methods related to I/O.
Field Summary | |
---|---|
static OutputStream |
NULL_OUTPUT_STREAM
The /dev/null output stream. |
static PrintStream |
NULL_PRINT_STREAM
The /dev/null print stream. |
Method Summary | |
---|---|
static void |
close(OutputStream os)
Close output streams that are not print streams. |
static void |
copy(InputStream input,
OutputStream output)
Copy an input to an output. |
static void |
fastCopy(FileInputStream input,
FileOutputStream output)
Perform a fast copy from file to file. |
static int |
getPort(URI uri)
Return the specified port or default port of an URI. |
static boolean |
isSecure(String scheme)
Indicates whether the given scheme is secure or not. |
static String |
readAll(InputStream input)
Read all an input stream in a string. |
static String |
readAll(Reader input)
Read all a character stream in a string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final OutputStream NULL_OUTPUT_STREAM
public static final PrintStream NULL_PRINT_STREAM
Method Detail |
---|
public static void close(OutputStream os) throws IOException
os
- The output stream to close.
IOException
- When an I/O exception occurs.PrintStream
public static void fastCopy(FileInputStream input, FileOutputStream output) throws IOException
input
- The input to read from.output
- The output to write to.
IOException
- When an I/O error occurs.public static void copy(InputStream input, OutputStream output) throws IOException
input
- The input to read from.output
- The output to write to.
IOException
- When an I/O error occurs.fastCopy(FileInputStream, FileOutputStream)
public static String readAll(InputStream input) throws IOException
input
- The input stream to read.
IOException
- When an I/O error occurs.public static String readAll(Reader input) throws IOException
input
- The character stream to read.
IOException
- When an I/O error occurs.public static boolean isSecure(String scheme)
scheme
- The scheme to test.
true
for https, sftp, ftps, or webdavs,
false
otherwise.public static int getPort(URI uri)
uri
- The URI.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |