jodd.io
Class StreamGobbler

java.lang.Object
  extended by java.lang.Thread
      extended by jodd.io.StreamGobbler
All Implemented Interfaces:
java.lang.Runnable

public class StreamGobbler
extends java.lang.Thread

Consumes a stream. For any Process, the input and error streams must read even if the data written to these streams is not used by the application. The generally accepted solution for this problem is a stream gobbler thread that does nothing but consume data from an input stream until stopped.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.io.InputStream is
           
protected  java.io.OutputStream os
           
protected  java.lang.String type
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
StreamGobbler(java.io.InputStream is)
           
StreamGobbler(java.io.InputStream is, java.io.OutputStream output)
           
StreamGobbler(java.io.InputStream is, java.lang.String type)
           
StreamGobbler(java.io.InputStream is, java.lang.String type, java.io.OutputStream output)
           
 
Method Summary
 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

is

protected final java.io.InputStream is

type

protected final java.lang.String type

os

protected final java.io.OutputStream os
Constructor Detail

StreamGobbler

public StreamGobbler(java.io.InputStream is,
                     java.lang.String type)

StreamGobbler

public StreamGobbler(java.io.InputStream is)

StreamGobbler

public StreamGobbler(java.io.InputStream is,
                     java.io.OutputStream output)

StreamGobbler

public StreamGobbler(java.io.InputStream is,
                     java.lang.String type,
                     java.io.OutputStream output)
Method Detail

run

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


Copyright © 2003-2012 Jodd Team