|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.dna.common.util.IoUtil
@Immutable public class IoUtil

A set of utilities for more easily performing I/O.
| Method Summary | |
|---|---|
static boolean |
isSame(InputStream input1,
InputStream input2)
Write the entire contents of the supplied string to the given stream. |
static String |
read(File file)
Read and return the entire contents of the supplied File. |
static String |
read(InputStream stream)
Read and return the entire contents of the supplied InputStream. |
static String |
read(Reader reader)
Read and return the entire contents of the supplied Reader. |
static byte[] |
readBytes(File file)
Read and return the entire contents of the supplied file. |
static byte[] |
readBytes(InputStream stream)
Read and return the entire contents of the supplied stream. |
static void |
write(InputStream input,
OutputStream stream)
Write the entire contents of the supplied string to the given stream. |
static void |
write(Reader input,
Writer writer)
Write the entire contents of the supplied string to the given writer. |
static void |
write(String content,
OutputStream stream)
Write the entire contents of the supplied string to the given stream. |
static void |
write(String content,
Writer writer)
Write the entire contents of the supplied string to the given writer. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static byte[] readBytes(InputStream stream)
throws IOException
stream. This method always closes the stream when
finished reading.
stream - the stream to the contents; may be null
IOException - if there is an error reading the content
public static byte[] readBytes(File file)
throws IOException
file.
file - the file containing the contents; may be null
IOException - if there is an error reading the content
public static String read(Reader reader)
throws IOException
Reader. This method always closes the reader when finished
reading.
reader - the reader of the contents; may be null
IOException - if there is an error reading the content
public static String read(InputStream stream)
throws IOException
InputStream. This method always closes the stream when finished
reading.
stream - the streamed contents; may be null
IOException - if there is an error reading the content
public static String read(File file)
throws IOException
File.
file - the file containing the information to be read; may be null
IOException - if there is an error reading the content
public static void write(String content,
OutputStream stream)
throws IOException
content - the content to write to the stream; may be nullstream - the stream to which the content is to be written
IOException
IllegalArgumentException - if the stream is null
public static void write(String content,
Writer writer)
throws IOException
content - the content to write to the writer; may be nullwriter - the writer to which the content is to be written
IOException
IllegalArgumentException - if the writer is null
public static void write(InputStream input,
OutputStream stream)
throws IOException
input - the content to write to the stream; may be nullstream - the stream to which the content is to be written
IOException
IllegalArgumentException - if the stream is null
public static void write(Reader input,
Writer writer)
throws IOException
input - the content to write to the writer; may be nullwriter - the writer to which the content is to be written
IOException
IllegalArgumentException - if the writer is null
public static boolean isSame(InputStream input1,
InputStream input2)
throws IOException
input1 - the first streaminput2 - the second stream
IOException
IllegalArgumentException - if the stream is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||