TUM CCSM Commons

edu.tum.cs.commons.io
Class StreamReaderThread

java.lang.Object
  extended by java.lang.Thread
      extended by edu.tum.cs.commons.io.StreamReaderThread
All Implemented Interfaces:
java.lang.Runnable

public class StreamReaderThread
extends java.lang.Thread

A thread to drain an input stream.

Version:
$Rev: 26283 $
Author:
Elmar Juergens, Florian Deissenboeck, $Author: juergens $
Rating:
GREEN Hash: 25DAC0F50BA3CBA7C86127762780A8C4

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
StreamReaderThread(java.io.InputStream input)
          Create a new reader that reads the content of this stream in its own thread. => This call is non- blocking
 
Method Summary
 java.lang.String getContent()
          Returns the content read from the stream.
 void run()
          Reads content from the stream as long as the stream is not empty.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StreamReaderThread

public StreamReaderThread(java.io.InputStream input)
Create a new reader that reads the content of this stream in its own thread. => This call is non- blocking

Parameters:
input - Stream to read from.
Method Detail

run

public void run()
Reads content from the stream as long as the stream is not empty.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getContent

public java.lang.String getContent()
Returns the content read from the stream.


TUM CCSM Commons

TUM CCSM Commons - 2.7