MOEA Framework 2.12
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()
           
 
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()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

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.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!