Class InputStreamDrainer

  • All Implemented Interfaces:
    Runnable

    public final class InputStreamDrainer
    extends Thread
    Will drain the output stream.
    • Constructor Detail

      • InputStreamDrainer

        public InputStreamDrainer​(InputStream in)
        Create a drainer which will discard the read lines.
        Parameters:
        in - The input stream to drain
      • InputStreamDrainer

        public InputStreamDrainer​(InputStream in,
                                  OutputStream out)
        Create a drainer that will echo all read lines to out.
        Parameters:
        in - The input stream to drain
        out - Where to drain the stream into
    • Method Detail

      • addOutputStream

        public void addOutputStream​(OutputStream out)
        Adds an output stream to drain the output to.
        Parameters:
        out - The output stream
      • run

        public void run()
        Drain the stream.
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread