Class StreamGobbler

java.lang.Object
java.lang.Thread
jodd.io.StreamGobbler
All Implemented Interfaces:
Runnable

public class StreamGobbler extends Thread
Consumes a stream. For any Process, the input and error streams must read even if the data written to these streams is not used by the application. The generally accepted solution for this problem is a stream gobbler thread that does nothing but consume data from an input stream until stopped.
  • Field Details

    • is

      protected final InputStream is
    • prefix

      protected final String prefix
    • out

      protected final OutputStream out
    • lock

      protected final Object lock
    • end

      protected boolean end
  • Constructor Details

  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • waitFor

      public void waitFor()
      Waits for gobbler to end.