Class RuntimeExec.InputStreamReaderThread

  • All Implemented Interfaces:
    Runnable
    Enclosing class:
    RuntimeExec

    public static class RuntimeExec.InputStreamReaderThread
    extends Thread
    Gobbles an InputStream and writes it into a StringBuffer

    The reading of the input stream is buffered.

    • Constructor Detail

      • InputStreamReaderThread

        public InputStreamReaderThread​(InputStream is,
                                       Charset charset)
        Parameters:
        is - an input stream to read - it will be wrapped in a buffer for reading
    • Method Detail

      • run

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

        public void waitForCompletion()
        Waits for the run to complete.

        Remember to start the thread first

      • addToBuffer

        public void addToBuffer​(String msg)
        Parameters:
        msg - the message to add to the buffer
      • isComplete

        public boolean isComplete()
      • getBuffer

        public String getBuffer()
        Returns:
        Returns the current state of the buffer