# Class StreamGobbler

java.lang.Object
java.lang.Thread
org.snpeff.osCmd.StreamGobbler

All Implemented Interfaces:
  `Runnable`

public class StreamGobbler extends Thread
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

Fields
Modifier and Type
Field
Description
`static int`
`BUFFER_SIZE`
`static int`
`HEAD_SIZE`

### Fields inherited from class Thread

`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

## Method Summary

Modifier and Type
Method
Description
`String`
`getAlert()`
`Object`
`getAlertNotify()`
`String`
`getAllLines()`
`String`
`getHead()`
Head: First HEAD_SIZE lines of this output
`String`
`getRedirectTo()`
`boolean`
`isAlertDone()`
`boolean`
`isBinary()`
`boolean`
`isRunning()`
`void`
`resetBuffer()`
`void`
`run()`
`void`
`setAlert(String alert)`
`void`
`setAlertNotify(Object alertNotify)`
`void`
`setBinary(boolean binary)`
`void`
`setLineFilter(LineFilter lineFilter)`
`void`
`setProgress(Progress progress)`
`void`
`setQuietMode()`
`void`
`setRedirectTo(String redirectTo)`
`void`
`setSaveLinesInMemory(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`

### Methods inherited from class Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### HEAD_SIZE

public static int HEAD_SIZE

### BUFFER_SIZE

public static int BUFFER_SIZE

## Method Details

### getAlert

public String getAlert()

### getAlertNotify

public Object getAlertNotify()

### getAllLines

public String getAllLines()

### getHead

public String getHead()
Head: First HEAD_SIZE lines of this output

Returns:

### getRedirectTo

public String getRedirectTo()

### isAlertDone

public boolean isAlertDone()

### isBinary

public boolean isBinary()

### isRunning

public boolean isRunning()

### resetBuffer

public void resetBuffer()

### run

public void run()

Specified by:
  `run` in interface `Runnable`
Overrides:
  `run` in class `Thread`

### setAlert

public void setAlert(String alert)

### setAlertNotify

public void setAlertNotify(Object alertNotify)

### setBinary

public void setBinary(boolean binary)

### setLineFilter

public void setLineFilter(LineFilter lineFilter)

### setProgress

public void setProgress(Progress progress)

### setQuietMode

public void setQuietMode()

### setRedirectTo

public void setRedirectTo(String redirectTo)

### setSaveLinesInMemory

public void setSaveLinesInMemory(boolean saveLinesInMemory)