MOEA Framework 2.5
API Specification

org.moeaframework.util.io
Class RedirectStream

java.lang.Object
  extended by java.lang.Thread
      extended by org.moeaframework.util.io.RedirectStream
All Implemented Interfaces:
Runnable

public class RedirectStream
extends Thread

Redirects all content received by an InputStream to an OutputStream. This thread terminates when the input stream is closed or the end of file is reached. The output stream is never closed.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static void redirect(InputStream inputStream)
          Reads all the contents of the specified input stream.
static void redirect(InputStream inputStream, OutputStream outputStream)
          Redirects all the contents from the specified input stream to the specified output stream.
 void run()
          If this thread was constructed using a separate Runnable run object, then that Runnable object's run method is called; otherwise, this method does nothing and returns.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

run

public void run()
Description copied from class: java.lang.Thread
If this thread was constructed using a separate Runnable run object, then that Runnable object's run method is called; otherwise, this method does nothing and returns.

Subclasses of Thread should override this method.

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Thread.start(), Thread.stop(), Thread.Thread(ThreadGroup, Runnable, String)

redirect

public static void redirect(InputStream inputStream)
Reads all the contents of the specified input stream. The contents are immediately deleted and are not redirected anywhere.

Parameters:
inputStream - the input stream from which content is read

redirect

public static void redirect(InputStream inputStream,
                            OutputStream outputStream)
Redirects all the contents from the specified input stream to the specified output stream.

Parameters:
inputStream - the input stream from which content is read
outputStream - the output stream to which the content is redirected

MOEA Framework 2.5
API Specification

Copyright 2009-2015 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Hosted by Get MOEA Framework at SourceForge.net. Fast, secure and Free Open Source software downloads