Package nl.esciencecenter.xenon.utils
Class InputWriter
- java.lang.Object
-
- java.lang.Thread
-
- nl.esciencecenter.xenon.utils.InputWriter
-
- All Implemented Interfaces:
java.lang.Runnable
public final class InputWriter extends java.lang.Thread
A simple input writer that uses a daemon thread to write from anString
to anOutputStream
. Once the end of the string is reached, the destination stream will be closed.
-
-
Constructor Summary
Constructors Constructor Description InputWriter(java.lang.String content, java.io.OutputStream destination)
Create a new InputWriter that writescontent
to thedestination
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isFinished()
Poll if the InputWriter has finished writing.void
run()
Entry point for the Daemon thread.void
waitUntilFinished()
Wait until the InputWriter has finished writing.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
-
-
-
-
Method Detail
-
isFinished
public boolean isFinished()
Poll if the InputWriter has finished writing.- Returns:
- if the InputWriter has finished writing.
-
waitUntilFinished
public void waitUntilFinished()
Wait until the InputWriter has finished writing.
-
run
public void run()
Entry point for the Daemon thread.- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
-