|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrailo.commons.io.IOUtil
public final class IOUtil
I/O Util
Constructor Summary | |
---|---|
IOUtil()
|
Method Summary | |
---|---|
static void |
checkEncoding(String encoding)
check if given encoding is ok |
static void |
closeEL(Closeable c)
close Closeable without a Exception |
static void |
closeEL(com.lowagie.text.Document doc)
|
static void |
closeEL(InputStream is)
close inputstream without a Exception |
static void |
closeEL(InputStream is,
OutputStream os)
close inputstream without a Exception |
static void |
closeEL(Object obj)
call close method from any Object with a close method. |
static void |
closeEL(OutputStream os)
close outputstream without a Exception |
static void |
closeEL(Reader r)
close Reader without a Exception |
static void |
closeEL(javax.mail.Transport t)
close Writer without a Exception |
static void |
closeEL(Writer w)
close Writer without a Exception |
static void |
closeEL(ZipFile zip)
|
void |
copy(File in,
File out)
copy content of in file to out File |
static void |
copy(InputStream in,
OutputStream out,
boolean closeIS,
boolean closeOS)
copy a inputstream to a outputstream |
static void |
copy(InputStream in,
OutputStream out,
int offset,
int length)
|
static void |
copy(InputStream in,
OutputStream out,
int offset,
int length,
int blockSize)
|
static void |
copy(InputStream in,
OutputStream out,
long offset,
long length)
|
static void |
copy(InputStream is,
Resource out,
boolean closeIS)
copy a input resource to a output resource |
static void |
copy(OutputStream out,
InputStream in,
boolean closeIS,
boolean closeOS)
copy a inputstream to a outputstream |
static void |
copy(Reader reader,
Writer writer,
boolean closeReader,
boolean closeWriter)
copy a reader to a writer |
static void |
copy(Resource in,
OutputStream os,
boolean closeOS)
copy a input resource to a output resource |
static void |
copy(Resource in,
Resource out)
copy a input resource to a output resource |
static void |
flushEL(OutputStream os)
flush OutputStream without a Exception |
static void |
flushEL(Writer w)
flush OutputStream without a Exception |
static BufferedReader |
getBufferedReader(Resource res,
String charset)
|
static String |
getMimeType(byte[] barr,
String defaultValue)
return the mime type of a file, dont check extension |
static String |
getMimeType(InputStream is,
String defaultValue)
return the mime type of a file, dont check extension |
static Reader |
getReader(InputStream is,
String charset)
|
static Reader |
getReader(Resource res,
String charset)
|
static Writer |
getWriter(File file,
String charset)
returns a Reader for the given File and charset (Automaticly check BOM Files) |
static Writer |
getWriter(File file,
String charset,
boolean append)
returns a Reader for the given File and charset (Automaticly check BOM Files) |
static Writer |
getWriter(OutputStream os,
String charset)
returns a Reader for the given InputStream |
static Writer |
getWriter(Resource res,
String charset)
|
static Writer |
getWriter(Resource res,
String charset,
boolean append)
|
static void |
merge(InputStream in1,
InputStream in2,
OutputStream out,
boolean closeIS1,
boolean closeIS2,
boolean closeOS)
copy a inputstream to a outputstream |
static void |
merge(Resource in1,
Resource in2,
Resource out)
|
static String |
read(Reader reader,
char[] carr)
|
static String |
read(Reader reader,
int size)
|
static BufferedInputStream |
toBufferedInputStream(InputStream is)
|
static BufferedOutputStream |
toBufferedOutputStream(OutputStream os)
|
static BufferedReader |
toBufferedReader(Reader r)
|
static BufferedWriter |
toBufferedWriter(Writer w)
|
static byte[] |
toBytes(File file)
|
static byte[] |
toBytes(InputStream is)
|
static byte[] |
toBytes(InputStream is,
boolean closeStream)
|
static byte[] |
toBytes(Resource res)
|
static byte[] |
toBytesMax(InputStream is,
int max)
|
static String |
toString(byte[] barr,
String charset)
|
static String |
toString(InputStream is,
String charset)
reads string data from a InputStream |
static String |
toString(Reader reader)
reads String data from a Reader |
static String |
toString(Reader reader,
boolean buffered)
reads String data from a Reader |
static String |
toString(Resource file,
String charset)
reads String data from File |
static String[] |
toStringArray(Reader reader)
|
static void |
write(File file,
String string,
String charset,
boolean append)
writes a String to a object |
static void |
write(Resource res,
byte[] barr)
|
static void |
write(Resource res,
byte[] barr,
boolean append)
|
static void |
write(Resource res,
String string,
String charset,
boolean append)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IOUtil()
Method Detail |
---|
public static final void copy(InputStream in, OutputStream out, boolean closeIS, boolean closeOS) throws IOException
in
- out
- closeIS
- closeOS
-
IOException
public static final void merge(InputStream in1, InputStream in2, OutputStream out, boolean closeIS1, boolean closeIS2, boolean closeOS) throws IOException
in
- out
- closeIS
- closeOS
-
IOException
public static final void copy(OutputStream out, InputStream in, boolean closeIS, boolean closeOS) throws IOException
in
- out
- closeIS
- closeOS
-
IOException
public static void copy(Resource in, Resource out) throws IOException
in
- out
-
IOException
public static void merge(Resource in1, Resource in2, Resource out) throws IOException
IOException
public static void copy(InputStream is, Resource out, boolean closeIS) throws IOException
in
- out
-
IOException
public static void copy(Resource in, OutputStream os, boolean closeOS) throws IOException
in
- out
-
IOException
public static final void copy(InputStream in, OutputStream out, int offset, int length) throws IOException
IOException
public static final void copy(InputStream in, OutputStream out, long offset, long length) throws IOException
IOException
public static final void copy(InputStream in, OutputStream out, int offset, int length, int blockSize) throws IOException
IOException
public static final void copy(Reader reader, Writer writer, boolean closeReader, boolean closeWriter) throws IOException
reader
- writer
- closeReader
- closeWriter
-
IOException
public void copy(File in, File out) throws IOException
in
- inputout
- output
IOException
public static void closeEL(InputStream is, OutputStream os)
is
- os
- public static void closeEL(InputStream is)
is
- public static void closeEL(ZipFile zip)
public static void closeEL(OutputStream os)
os
- public static void closeEL(Reader r)
r
- public static void closeEL(Closeable c)
r
- public static void closeEL(Writer w)
w
- public static void closeEL(javax.mail.Transport t)
w
- public static void closeEL(com.lowagie.text.Document doc)
public static void closeEL(Object obj)
obj
- public static Reader getReader(Resource res, String charset) throws IOException
IOException
public static Reader getReader(InputStream is, String charset) throws IOException
IOException
public static String toString(InputStream is, String charset) throws IOException
is
- charset
-
IOException
public static String toString(byte[] barr, String charset) throws IOException
IOException
public static String toString(Reader reader) throws IOException
reader
-
IOException
public static String toString(Reader reader, boolean buffered) throws IOException
reader
-
IOException
public static String toString(Resource file, String charset) throws IOException
file
- charset
-
IOException
public static String[] toStringArray(Reader reader) throws IOException
reader
- Reader to get content from it
IOException
public static void write(File file, String string, String charset, boolean append) throws IOException
file
- string
- String to write to filecharset
- append
- append to cuuretn data or overwrite existing data
IOException
public static void write(Resource res, String string, String charset, boolean append) throws IOException
IOException
public static void write(Resource res, byte[] barr) throws IOException
IOException
public static void write(Resource res, byte[] barr, boolean append) throws IOException
IOException
public static byte[] toBytes(File file) throws IOException
file
-
IOException
public static byte[] toBytes(Resource res) throws IOException
res
-
IOException
public static BufferedInputStream toBufferedInputStream(InputStream is)
public static BufferedOutputStream toBufferedOutputStream(OutputStream os)
public static BufferedReader toBufferedReader(Reader r)
public static BufferedReader getBufferedReader(Resource res, String charset) throws IOException
IOException
public static BufferedWriter toBufferedWriter(Writer w)
public static byte[] toBytes(InputStream is) throws IOException
is
-
IOException
public static byte[] toBytes(InputStream is, boolean closeStream) throws IOException
IOException
public static byte[] toBytesMax(InputStream is, int max) throws IOException
IOException
public static void flushEL(OutputStream os)
os
- public static void flushEL(Writer w)
os
- public static void checkEncoding(String encoding) throws IOException
encoding
-
PageException
IOException
public static String getMimeType(InputStream is, String defaultValue)
barr
- defaultValue
-
public static String getMimeType(byte[] barr, String defaultValue)
barr
-
IOException
public static Writer getWriter(Resource res, String charset) throws IOException
IOException
public static Writer getWriter(Resource res, String charset, boolean append) throws IOException
IOException
public static Writer getWriter(File file, String charset) throws IOException
file
- charset
-
IOException
public static Writer getWriter(File file, String charset, boolean append) throws IOException
file
- charset
-
IOException
public static Writer getWriter(OutputStream os, String charset) throws IOException
is
- charset
-
IOException
public static String read(Reader reader, int size) throws IOException
IOException
public static String read(Reader reader, char[] carr) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |