org.activemath.util
Class InToOutStream

java.lang.Object
  extended by java.lang.Thread
      extended by org.activemath.util.InToOutStream
All Implemented Interfaces:
Runnable

public class InToOutStream
extends Thread

A simple class and thread to read from an input-stream and write to the outputstream. The outputStream is written to at every end of line or every 512 characters.

Any exception occuring while reading stops the thread and is stored in the #excpetion variable.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 Exception exception
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
InToOutStream(InputStream in, OutputStream out)
           
 
Method Summary
static void main(String[] args)
          For testing: cats a file.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

exception

public Exception exception
Constructor Detail

InToOutStream

public InToOutStream(InputStream in,
                     OutputStream out)
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

main

public static void main(String[] args)
                 throws IOException
For testing: cats a file.

Throws:
IOException