Package jodd.io
Class StreamGobbler
- java.lang.Object
-
- java.lang.Thread
-
- jodd.io.StreamGobbler
-
- All Implemented Interfaces:
java.lang.Runnable
public class StreamGobbler extends java.lang.ThreadConsumes a stream. For anyProcess, 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.
-
-
Constructor Summary
Constructors Constructor Description StreamGobbler(java.io.InputStream is)StreamGobbler(java.io.InputStream is, java.io.OutputStream output)StreamGobbler(java.io.InputStream is, java.io.OutputStream output, java.lang.String prefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()voidwaitFor()Waits for gobbler to end.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-