Package org.openjdk.jmh.util
Class InputStreamDrainer
- java.lang.Object
-
- java.lang.Thread
-
- org.openjdk.jmh.util.InputStreamDrainer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description InputStreamDrainer(InputStream in)
Create a drainer which will discard the read lines.InputStreamDrainer(InputStream in, OutputStream out)
Create a drainer that will echo all read lines toout
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOutputStream(OutputStream out)
Adds an output stream to drain the output to.void
run()
Drain the stream.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
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 toout
.- Parameters:
in
- The input stream to drainout
- 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
-
-