org.mortbay.util
Class IO

java.lang.Object
  |
  +--org.mortbay.util.ThreadPool
        |
        +--org.mortbay.util.IO
All Implemented Interfaces:
LifeCycle

public class IO
extends ThreadPool

IO Utilities. Provides stream handling utilities in singleton Threadpool implementation accessed by static members.


Inner classes inherited from class org.mortbay.util.ThreadPool
ThreadPool.PoolThread
 
Field Summary
static int bufferSize
           
 
Fields inherited from class org.mortbay.util.ThreadPool
__nullLockChecks
 
Constructor Summary
IO()
           
 
Method Summary
static void copy(java.io.InputStream in, java.io.OutputStream out)
          Copy Stream in to Stream out until EOF or exception.
static void copy(java.io.InputStream in, java.io.OutputStream out, long byteCount)
          Copy Stream in to Stream for byteCount bytes or until EOF or exception.
static void copy(java.io.Reader in, java.io.Writer out)
          Copy Reader to Writer out until EOF or exception.
static void copy(java.io.Reader in, java.io.Writer out, long byteCount)
          Copy Reader to Writer for byteCount bytes or until EOF or exception.
static void copyThread(java.io.InputStream in, java.io.OutputStream out)
          Copy Stream in to Stream out until EOF or exception.
static void copyThread(java.io.Reader in, java.io.Writer out)
          Copy Stream in to Stream out until EOF or exception in own thread
static java.io.OutputStream getNullStream()
           
static java.io.Writer getNullWriter()
           
 void handle(java.lang.Object o)
          Run copy for copyThread()
static IO instance()
           
static java.lang.String toString(java.io.InputStream in)
          Read input stream to string
 
Methods inherited from class org.mortbay.util.ThreadPool
destroy, getIdleThreads, getJob, getMaxIdleTimeMs, getMaxSize, getMaxStopTimeMs, getMaxThreads, getMinSize, getMinThreads, getName, getSize, getThreadClass, getThreads, initialize, isDestroyed, isStarted, join, run, setMaxIdleTimeMs, setMaxSize, setMaxStopTimeMs, setMaxThreads, setMinSize, setMinThreads, setName, setThreadClass, start, stop, stopJob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufferSize

public static int bufferSize
Constructor Detail

IO

public IO()
Method Detail

instance

public static IO instance()

copyThread

public static void copyThread(java.io.InputStream in,
                              java.io.OutputStream out)
Copy Stream in to Stream out until EOF or exception. in own thread

copy

public static void copy(java.io.InputStream in,
                        java.io.OutputStream out)
                 throws java.io.IOException
Copy Stream in to Stream out until EOF or exception.

copyThread

public static void copyThread(java.io.Reader in,
                              java.io.Writer out)
Copy Stream in to Stream out until EOF or exception in own thread

copy

public static void copy(java.io.Reader in,
                        java.io.Writer out)
                 throws java.io.IOException
Copy Reader to Writer out until EOF or exception.

copy

public static void copy(java.io.InputStream in,
                        java.io.OutputStream out,
                        long byteCount)
                 throws java.io.IOException
Copy Stream in to Stream for byteCount bytes or until EOF or exception.

copy

public static void copy(java.io.Reader in,
                        java.io.Writer out,
                        long byteCount)
                 throws java.io.IOException
Copy Reader to Writer for byteCount bytes or until EOF or exception.

toString

public static java.lang.String toString(java.io.InputStream in)
                                 throws java.io.IOException
Read input stream to string
Parameters:
in -  
Returns:
 

handle

public void handle(java.lang.Object o)
Run copy for copyThread()
Overrides:
handle in class ThreadPool
Following copied from class: org.mortbay.util.ThreadPool
Parameters:
job - The Job to handle. If it implements Runnable, this implementation calls run().

getNullStream

public static java.io.OutputStream getNullStream()
Returns:
An outputstream to nowhere

getNullWriter

public static java.io.Writer getNullWriter()
Returns:
An writer to nowhere


Copyright © GNU, wttools developers Team.