Class StreamGobbler
java.lang.Object
java.lang.Thread
org.snpeff.osCmd.StreamGobbler
- All Implemented Interfaces:
Runnable
Read the contents of a stream in a separate thread
This class is used when executing OS commands in order to read STDOUT / STDERR and prevent process blocking
It can alert an AlertListener when a given string is in the stream
- Author:
- pcingola
-
Nested Class Summary
Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsFields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptiongetAlert()getHead()Head: First HEAD_SIZE lines of this outputbooleanbooleanisBinary()booleanvoidvoidrun()voidvoidsetAlertNotify(Object alertNotify) voidsetBinary(boolean binary) voidsetLineFilter(LineFilter lineFilter) voidsetProgress(Progress progress) voidvoidsetRedirectTo(String redirectTo) voidsetSaveLinesInMemory(boolean saveLinesInMemory) Methods inherited from class Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, threadId, toString, yield
-
Field Details
-
HEAD_SIZE
public static int HEAD_SIZE -
BUFFER_SIZE
public static int BUFFER_SIZE
-
-
Method Details
-
getAlert
-
getAlertNotify
-
getAllLines
-
getHead
-
getRedirectTo
-
isAlertDone
public boolean isAlertDone() -
isBinary
public boolean isBinary() -
isRunning
public boolean isRunning() -
resetBuffer
public void resetBuffer() -
run
-
setAlert
-
setAlertNotify
-
setBinary
public void setBinary(boolean binary) -
setLineFilter
-
setProgress
-
setQuietMode
public void setQuietMode() -
setRedirectTo
-
setSaveLinesInMemory
public void setSaveLinesInMemory(boolean saveLinesInMemory)
-