public class IO extends ThreadPool
ThreadPool.PoolThread
Modifier and Type | Field and Description |
---|---|
static int |
bufferSize |
static String |
CRLF |
static byte[] |
CRLF_BYTES |
__DAEMON, __PRIORITY
Constructor and Description |
---|
IO() |
Modifier and Type | Method and Description |
---|---|
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(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 |
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 OutputStream |
getNullStream() |
static Writer |
getNullWriter() |
void |
handle(Object o)
Run copy for copyThread()
|
static IO |
instance() |
static String |
toString(InputStream in)
Read input stream to string.
|
getIdleThreads, getMaxIdleTimeMs, getMaxThreads, getMinThreads, getName, getPoolName, getThreads, getThreadsPriority, isDaemon, isStarted, join, run, setDaemon, setMaxIdleTimeMs, setMaxStopTimeMs, setMaxThreads, setMinThreads, setName, setPoolName, setThreadsPriority, shrink, start, stop, stopJob
public static final String CRLF
public static final byte[] CRLF_BYTES
public static int bufferSize
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
in
- out
- IOException
public static void copy(InputStream in, OutputStream out, long byteCount) throws IOException
in
- out
- byteCount
- IOException
public static void copy(Reader in, Writer out, long byteCount) throws IOException
IOException
public static String toString(InputStream in) throws IOException
IOException
public static boolean delete(File file)
file
- The file to be deleted.public void handle(Object o)
handle
in class ThreadPool
o
- The job to execute.public static OutputStream getNullStream()
public static void close(InputStream is)
is
- the input stream to closepublic static void close(OutputStream os)
os
- the output stream to closepublic static Writer getNullWriter()
Copyright © 2013. All Rights Reserved.