Package org.snpeff.osCmd
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 java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
FieldsFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Method Summary
Modifier and TypeMethodDescriptiongetAlert()
getHead()
Head: First HEAD_SIZE lines of this outputboolean
boolean
isBinary()
boolean
void
void
run()
void
void
setAlertNotify
(Object alertNotify) void
setBinary
(boolean binary) void
setLineFilter
(LineFilter lineFilter) void
setProgress
(Progress progress) void
void
setRedirectTo
(String redirectTo) void
setSaveLinesInMemory
(boolean saveLinesInMemory) 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, 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
Head: First HEAD_SIZE lines of this output- Returns:
-
getRedirectTo
-
isAlertDone
public boolean isAlertDone() -
isBinary
public boolean isBinary() -
isRunning
public boolean isRunning() -
resetBuffer
public void resetBuffer() -
run
public void run() -
setAlert
-
setAlertNotify
-
setBinary
public void setBinary(boolean binary) -
setLineFilter
-
setProgress
-
setQuietMode
public void setQuietMode() -
setRedirectTo
-
setSaveLinesInMemory
public void setSaveLinesInMemory(boolean saveLinesInMemory)
-