net.sf.rej.util
Class StreamRedirector

java.lang.Object
  extended by net.sf.rej.util.StreamRedirector
All Implemented Interfaces:
java.lang.Runnable

public class StreamRedirector
extends java.lang.Object
implements java.lang.Runnable

Reads an InputStream in a loop for as long as there is data available, writing the data, line-by-line to a PrintStream.

Author:
Sami Koivu

Constructor Summary
StreamRedirector(java.io.InputStream is, java.io.PrintStream os)
          Initializes this object with the given InputStream to read from and the given PrintStream to write into.
 
Method Summary
 void run()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamRedirector

public StreamRedirector(java.io.InputStream is,
                        java.io.PrintStream os)
Initializes this object with the given InputStream to read from and the given PrintStream to write into.

Parameters:
is - the stream to write.
os - the stream in which to write.
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable