|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.uniba.euromath.tools.io.IOTools
public final class IOTools
Contains various utilities for working with streams, readers and writers.
| Method Summary | |
|---|---|
static void |
copyCharacters(Reader in,
Writer out)
Copies all characters from reader to writer. |
static void |
copyStream(InputStream in,
OutputStream out)
Copies all bytes from input stream to output stream. |
static InputStream |
createEmptyInputStream()
Produces empty input stream that is always at the end of stream data (it cannot read anything). |
static Reader |
createEmptyReader()
Produces empty reader that is always at the end of stream data (it cannot read anything). |
static OutputStream |
createNullOutputStream()
Deprecated. use NullOutputStream. |
static Writer |
createNullWriter()
Produces writer that throws all written data away (like null
device). |
static void |
encodeStream(Reader source,
OutputStream out,
String encoding)
Deprecated. use IOUtils.copy(Reader, OutputStream, String). |
static InputStream |
readerToInputStream(Reader reader,
String encoding)
Converts reader to an inputstream. |
static String |
readerToString(Reader in)
Deprecated. use IOUtils.toString(Reader) |
static Reader |
streamSourceToReader(StreamSource ssource,
String encoding)
Returns reader from given stream source. |
static InputStream |
stringToInputStream(String string,
String encoding)
Deprecated. use IOUtils.toInputStream(String, String). |
static IPath |
urlToPath(URL url)
Converts URL address to Eclipse IPath. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void copyStream(InputStream in,
OutputStream out)
throws IOException
in - the input streamout - the output stream
IOException - if i/o error occurs during reading and/or writing.
public static void copyCharacters(Reader in,
Writer out)
throws IOException
in - the input streamout - the output stream
IOException - if i/o error occurs during reading and/or writing.
@Deprecated
public static String readerToString(Reader in)
throws IOException
IOUtils.toString(Reader)
in - input reader
IOException - if i/o error occurs during reading.public static InputStream createEmptyInputStream()
public static Reader createEmptyReader()
@Deprecated public static OutputStream createNullOutputStream()
NullOutputStream.
null device).
null output stream.public static Writer createNullWriter()
null
device).
null writer.
public static Reader streamSourceToReader(StreamSource ssource,
String encoding)
throws UnsupportedEncodingException
ssource - the stream source.encoding - if no reader is given in ssource then create one from
input source using this encoding.
UnsupportedEncodingException - if encoding is not known.public static IPath urlToPath(URL url)
IPath. It must point into
a local file.
url - url address to convert.
IllegalArgumentException - if given URL is not file:/
address.
@Deprecated
public static InputStream stringToInputStream(String string,
String encoding)
throws IOException
IOUtils.toInputStream(String, String).
string - the source.encoding - the encoding.
IOException
public static InputStream readerToInputStream(Reader reader,
String encoding)
throws IOException
reader - reader to pollencoding - the encoding.
IOException - if construction of inputstream fails.
@Deprecated
public static void encodeStream(Reader source,
OutputStream out,
String encoding)
throws IOException
IOUtils.copy(Reader, OutputStream, String).
source - source reader, must not be null.out - the sink, must not be null.encoding - encode characters with this encoder, must not be
null.
IOException - if io error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||