Class ProcessReader


  • public class ProcessReader
    extends Object
    Class used to write the output and error of a given process in a printstream.
    • Constructor Detail

      • ProcessReader

        public ProcessReader​(Process process,
                             PrintStream printStream,
                             boolean isError)
        The constructor.
        Parameters:
        process - process whose output/error we want to write to the print stream.
        printStream - the print stream.
        isError - whether we must write the error (or the output) must be written to the stream.
    • Method Detail

      • startReading

        public void startReading()
        Starts reading the output (or error) of the process.
      • interrupt

        public void interrupt()
        Interrupts the reading of the output (or error) of the process. The method does not return until the reading is over.
      • getLastException

        public Throwable getLastException()
        Returns the last exception that occurred reading the output (or the error) of the process.
        Returns:
        the last exception that occurred reading the output (or the error) of the process.