Class InputStreamDrainer

java.lang.Object
java.lang.Thread
org.openjdk.jmh.util.InputStreamDrainer
All Implemented Interfaces:
Runnable

public final class InputStreamDrainer extends Thread
Will drain the output stream.
  • Field Details

  • Constructor Details

    • 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 Details

    • 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