public class StreamGobbler
extends java.lang.Thread
| Modifier and Type | Class and Description |
|---|---|
static interface |
StreamGobbler.OnLineListener
Line callback interface
|
| Constructor and Description |
|---|
StreamGobbler(java.lang.String shell,
java.io.InputStream inputStream,
java.util.List<java.lang.String> outputList)
StreamGobbler constructor
|
StreamGobbler(java.lang.String shell,
java.io.InputStream inputStream,
StreamGobbler.OnLineListener onLineListener)
StreamGobbler constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
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, yieldpublic StreamGobbler(java.lang.String shell,
java.io.InputStream inputStream,
java.util.List<java.lang.String> outputList)
StreamGobbler constructor
We use this class because shell STDOUT and STDERR should be read as quickly as possible to prevent a deadlock from occurring, or Process.waitFor() never returning (as the buffer is full, pausing the native process)
shell - Name of the shellinputStream - InputStream to read fromoutputList - List<String> to write to, or nullpublic StreamGobbler(java.lang.String shell,
java.io.InputStream inputStream,
StreamGobbler.OnLineListener onLineListener)
StreamGobbler constructor
We use this class because shell STDOUT and STDERR should be read as quickly as possible to prevent a deadlock from occurring, or Process.waitFor() never returning (as the buffer is full, pausing the native process)
shell - Name of the shellinputStream - InputStream to read fromonLineListener - OnLineListener callback