Class InputThread

  • All Implemented Interfaces:
    Runnable

    class InputThread
    extends Thread
    A thread that consumes an input stream.
    Since:
    0.5.0
    Version:
    $Id: InputThread.java 16154 2012-07-14 16:34:05Z colin $
    Author:
    tlerios@marketcetera.com
    • Constructor Detail

      • InputThread

        InputThread​(String command,
                    InputStream in,
                    OutputStream out,
                    boolean closeOut)
        Creates a new thread that consumes the given input stream of a process (which is fed by the standard output stream of the process). The input stream is copied to the given output stream in its entirety. Upon completion (successful or not), the input stream is closed; the output stream may also be closed depending on the given setting. I/O errors are logged, and the log messages include the given command that initiated the process.
        Parameters:
        command - The process command.
        in - The input stream (standard output stream of the process).
        out - The output stream.
        closeOut - True if the output stream should be closed.
    • Method Detail

      • run

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