Constructor and Description |
---|
IOUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkEncoding(String encoding)
check if given encoding is ok
|
static void |
closeEL(Closeable c)
close Closeable without a Exception
|
static void |
closeEL(Connection conn) |
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(ResultSet rs) |
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,
Charset charset) |
static BufferedReader |
getBufferedReader(Resource res,
String charset)
Deprecated.
use instead
|
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,
Charset charset) |
static Reader |
getReader(InputStream is,
String charset)
Deprecated.
use instead
|
static Reader |
getReader(Resource res,
Charset charset) |
static Reader |
getReader(Resource res,
String charset)
Deprecated.
use instead
|
static Writer |
getWriter(File file,
String charset)
Deprecated.
use instead
returns a Reader for the given File and charset (Automaticly check BOM Files) |
static Writer |
getWriter(File file,
String charset,
boolean append)
Deprecated.
use instead
returns a Reader for the given File and charset (Automaticly check BOM Files) |
static Writer |
getWriter(OutputStream os,
Charset charset)
returns a Reader for the given InputStream
|
static Writer |
getWriter(OutputStream os,
String charset)
Deprecated.
use instead
|
static Writer |
getWriter(Resource res,
Charset charset) |
static Writer |
getWriter(Resource res,
Charset charset,
boolean append) |
static Writer |
getWriter(Resource res,
String charset)
Deprecated.
use instead
|
static Writer |
getWriter(Resource res,
String charset,
boolean append)
Deprecated.
use instead
|
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)
Deprecated.
use instead
|
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,
Charset charset) |
static String |
toString(byte[] barr,
String charset)
Deprecated.
use instead
|
static String |
toString(InputStream is,
Charset charset)
reads string data from a InputStream
|
static String |
toString(InputStream is,
Charset charset,
long timeout)
reads string data from a InputStream
|
static String |
toString(InputStream is,
String charset)
Deprecated.
use instead
|
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(Reader reader,
long timeout)
reads String data from a Reader
|
static String |
toString(Resource file,
Charset charset)
reads String data from File
|
static String |
toString(Resource file,
String charset)
Deprecated.
use instead
|
static String[] |
toStringArray(Reader reader) |
static void |
write(File file,
String string,
String strCharset,
boolean append)
Deprecated.
use instead
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,
Charset charset,
boolean append) |
static void |
write(Resource res,
String string,
String charset,
boolean append)
Deprecated.
use instead
|
public IOUtil()
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
- outputIOException
public static void closeEL(InputStream is, OutputStream os)
is
- os
- public static void closeEL(InputStream is)
is
- public static void closeEL(OutputStream os)
os
- public static void closeEL(javax.mail.Transport t)
w
- public static void closeEL(com.lowagie.text.Document doc)
public static void closeEL(Connection conn)
public static void closeEL(Object obj)
obj
- public static Reader getReader(Resource res, String charset) throws IOException
getReader(Resource, Charset)
res
- charset
- IOException
public static Reader getReader(Resource res, Charset charset) throws IOException
IOException
public static Reader getReader(InputStream is, Charset charset) throws IOException
IOException
public static Reader getReader(InputStream is, String charset) throws IOException
getReader(InputStream, Charset)
is
- charset
- IOException
public static String toString(InputStream is, String charset) throws IOException
toString(InputStream, Charset)
is
- charset
- IOException
public static String toString(InputStream is, Charset charset) throws IOException
is
- charset
- IOException
public static String toString(InputStream is, Charset charset, long timeout) throws IOException
is
- charset
- timeout
- in millisecondsIOException
public static String toString(byte[] barr, String charset) throws IOException
toString(byte[], Charset)
barr
- charset
- IOException
public static String toString(byte[] barr, Charset charset) throws IOException
IOException
public static String toString(Reader reader) throws IOException
reader
- IOException
public static String toString(Reader reader, long timeout) throws IOException
reader
- timeout
- timeout in millisecondsIOException
public static String toString(Reader reader, boolean buffered) throws IOException
reader
- IOException
public static String toString(Resource file, String charset) throws IOException
toString(Resource, Charset)
file
- charset
- IOException
public static String toString(Resource file, Charset charset) throws IOException
file
- charset
- IOException
public static String[] toStringArray(Reader reader) throws IOException
reader
- Reader to get content from itIOException
public static void write(File file, String string, String strCharset, boolean append) throws IOException
write(Resource, String, Charset, boolean)
writes a String to a objectfile
- string
- String to write to filecharset
- append
- append to cuuretn data or overwrite existing dataIOException
public static void write(Resource res, String string, String charset, boolean append) throws IOException
write(Resource, String, Charset, boolean)
res
- string
- charset
- append
- IOException
public static void write(Resource res, String string, Charset 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
toBytes(Resource)
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
getBufferedReader(Resource, Charset)
res
- charset
- IOException
public static BufferedReader getBufferedReader(Resource res, Charset 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 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
getWriter(Resource, Charset)
res
- charset
- IOException
public static Writer getWriter(Resource res, Charset charset) throws IOException
IOException
public static Writer getWriter(Resource res, String charset, boolean append) throws IOException
getWriter(Resource, Charset,boolean)
res
- charset
- append
- IOException
public static Writer getWriter(Resource res, Charset charset, boolean append) throws IOException
IOException
public static Writer getWriter(File file, String charset) throws IOException
getWriter(Resource, Charset)
returns a Reader for the given File and charset (Automaticly check BOM Files)file
- charset
- IOException
public static Writer getWriter(File file, String charset, boolean append) throws IOException
getWriter(Resource, Charset, boolean)
returns a Reader for the given File and charset (Automaticly check BOM Files)file
- charset
- IOException
public static Writer getWriter(OutputStream os, String charset) throws IOException
getWriter(OutputStream, Charset)
os
- charset
- IOException
public static Writer getWriter(OutputStream os, Charset 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
Copyright © 2015 Lucee