|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.component.AbstractLifeCycle org.mortbay.thread.BoundedThreadPool org.mortbay.util.IO
public class IO
IO Utilities. Provides stream handling utilities in singleton Threadpool implementation accessed by static members.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.mortbay.thread.BoundedThreadPool |
---|
BoundedThreadPool.PoolThread |
Field Summary | |
---|---|
static int |
bufferSize
|
static String |
CRLF
|
static byte[] |
CRLF_BYTES
|
Constructor Summary | |
---|---|
IO()
|
Method Summary | |
---|---|
static void |
close(InputStream is)
closes an input stream, and logs exceptions |
static void |
close(OutputStream os)
closes an output stream, and logs exceptions |
static void |
copy(File from,
File to)
Copy files or directories |
static void |
copy(InputStream in,
OutputStream out)
Copy Stream in to Stream out until EOF or exception. |
static void |
copy(InputStream in,
OutputStream out,
long byteCount)
Copy Stream in to Stream for byteCount bytes or until EOF or exception. |
static void |
copy(Reader in,
Writer out)
Copy Reader to Writer out until EOF or exception. |
static void |
copy(Reader in,
Writer out,
long byteCount)
Copy Reader to Writer for byteCount bytes or until EOF or exception. |
static void |
copyDir(File from,
File to)
|
static void |
copyFile(File from,
File to)
|
static void |
copyThread(InputStream in,
OutputStream out)
Copy Stream in to Stream out until EOF or exception. |
static void |
copyThread(Reader in,
Writer out)
Copy Stream in to Stream out until EOF or exception in own thread |
static boolean |
delete(File file)
Delete File. |
static InputStream |
getClosedStream()
|
static OutputStream |
getNullStream()
|
static Writer |
getNullWriter()
|
static IO |
instance()
|
static byte[] |
readBytes(InputStream in)
|
static String |
toString(InputStream in)
Read input stream to string. |
static String |
toString(InputStream in,
String encoding)
Read input stream to string. |
static String |
toString(Reader in)
Read input stream to string. |
Methods inherited from class org.mortbay.thread.BoundedThreadPool |
---|
dispatch, doStart, doStop, getIdleThreads, getLowThreads, getMaxIdleTimeMs, getMaxThreads, getMinThreads, getName, getThreads, getThreadsPriority, isDaemon, isLowOnThreads, join, newThread, setDaemon, setLowThreads, setMaxIdleTimeMs, setMaxThreads, setMinThreads, setName, setThreadsPriority, stopJob |
Methods inherited from class org.mortbay.component.AbstractLifeCycle |
---|
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CRLF
public static final byte[] CRLF_BYTES
public static int bufferSize
Constructor Detail |
---|
public IO()
Method Detail |
---|
public static IO instance()
public static void copyThread(InputStream in, OutputStream out)
public static void copy(InputStream in, OutputStream out) throws IOException
IOException
public static void copyThread(Reader in, Writer out)
public static void copy(Reader in, Writer out) throws IOException
IOException
public static void copy(InputStream in, OutputStream out, long byteCount) throws IOException
IOException
public static void copy(Reader in, Writer out, long byteCount) throws IOException
IOException
public static void copy(File from, File to) throws IOException
from
- to
-
IOException
public static void copyDir(File from, File to) throws IOException
IOException
public static void copyFile(File from, File to) throws IOException
IOException
public static String toString(InputStream in) throws IOException
IOException
public static String toString(InputStream in, String encoding) throws IOException
IOException
public static String toString(Reader in) throws IOException
IOException
public static boolean delete(File file)
file
- The file to be deleted.public static void close(InputStream is)
is
- the input stream to closepublic static byte[] readBytes(InputStream in) throws IOException
IOException
public static void close(OutputStream os)
os
- the output stream to closepublic static OutputStream getNullStream()
public static InputStream getClosedStream()
public static Writer getNullWriter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |