Class ReadInto

  • All Implemented Interfaces:
    Runnable

    public class ReadInto
    extends Thread
    This class takes an InputStream and either accumulates the read bytes in a String or outputs to a PrintStream.

    Its intended use is to catch the output and error streams of Process instances.

    Author:
    Johannes Schindelin
    • Constructor Detail

      • ReadInto

        public ReadInto​(InputStream in,
                        PrintStream out)
        Construct a ReadInto thread and start it right away.
        Parameters:
        in - the stream to read
        out - the stream to print to; if it is null, the toString() method will have the output instead
      • ReadInto

        public ReadInto​(InputStream in,
                        PrintStream out,
                        boolean closeOnEOF)
        Construct a ReadInto thread and start it right away.
        Parameters:
        in - the stream to read
        out - the stream to print to; if it is null, the toString() method will have the output instead