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
  • 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)