Class JsHinter.StreamReaderThread

java.lang.Object
java.lang.Thread
org.fife.rsta.ac.js.JsHinter.StreamReaderThread
All Implemented Interfaces:
Runnable
Enclosing class:
JsHinter

static class JsHinter.StreamReaderThread extends Thread
A thread dedicated to reading either the stdout or stderr stream of an external process. These streams are read in a dedicated thread to ensure they are consumed appropriately to prevent deadlock. This idea was taken from this JavaWorld article.
Version:
1.0
  • Field Details

  • Constructor Details

    • StreamReaderThread

      public StreamReaderThread(InputStream in)
      Constructor.
      Parameters:
      in - The stream (stdout or stderr) to read from.
  • Method Details

    • getStreamOutput

      public String getStreamOutput()
      Returns the output read from the stream.
      Returns:
      The stream's output, as a String.
    • run

      public void run()
      Continually reads from the output stream until this thread is interrupted.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread