- All Implemented Interfaces:
public class ISPT extends java.lang.Thread
ISPT - Documentation.
ISPT: InputStream Printing Thread
This class is used to asynchronously print
Stringdata from both
Terminal Standard-Outputand also
Terminal Standard-Errorto an output
java.lang.Appendable. All it is is an extension of Java
class Threadthat receives an instance of
InputStreamto its constructor, and, when started as a
Thread, prints the contents of the
InputStreamto a user provided
Internally, this class simply builds a
java.lang.Runnablethat will execute when the
'this' Thread's Thread.start()method is invoked. This class was designed for use with the
'Completed'thread-monitor system for printing output from one
InputStreamto a user provided output
Appendablemechanism - asynchronously. The need for 'asynchronous' printing arose out of using the
class java.lang.Processwhich has the behaviour of sending output to two different text-streams (
Standard-Error) at the same time. Though is usually not a problem, depending upon which O/S the JVM is running, thread-freezing may occur where the entire JVM halts because one of the streams isn't being serviced. The only way to prevent such problems is to use asynchronously print monitoring.
All Methods Instance Methods Concrete Methods Modifier and Type Method
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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
public ISPT(java.io.InputStream inputStream, java.lang.Appendable appendable, Completed completed, java.lang.String name)This shall build a
Threadthat asynchronously prints text read from an
InputStreamdirectly to the provided
InputStreamto be read.
appendable- Where the read text shall be sent
completed- This class only works in coordination with the
class 'Completed'. This class is used to allow the user to
'wait'until this independent
Threadhas run to completion.
Threadthat is created (as
class 'Thread', shall have the
'name'that is provided to this parameter.
public int numCharsRead()This returns a count on the number of characters that have been read from the
- Number of characters that have been read from the
- Exact Method Body: