Class InputStreamDrainer
java.lang.Object
java.lang.Thread
org.openjdk.jmh.util.InputStreamDrainer
- All Implemented Interfaces:
Runnable
Will drain the output stream.
-
Nested Class Summary
Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final InputStreamprivate final List<OutputStream> Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionCreate 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
Modifier and TypeMethodDescriptionvoidAdds an output stream to drain the output to.voidrun()Drain the stream.Methods inherited from class Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, threadId, toString, yield
-
Field Details
-
BUF_SIZE
private static final int BUF_SIZE- See Also:
-
outs
-
in
-
-
Constructor Details
-
InputStreamDrainer
Create a drainer which will discard the read lines.- Parameters:
in- The input stream to drain
-
InputStreamDrainer
Create a drainer that will echo all read lines toout.- Parameters:
in- The input stream to drainout- Where to drain the stream into
-
-
Method Details
-
addOutputStream
Adds an output stream to drain the output to.- Parameters:
out- The output stream
-
run
-