com.continuent.tungsten.common.exec
Class StringInputStreamSink

java.lang.Object
  extended by com.continuent.tungsten.common.exec.StringInputStreamSink
All Implemented Interfaces:
InputStreamSink, java.lang.Runnable

public class StringInputStreamSink
extends java.lang.Object
implements InputStreamSink

Runnable to read from an InputStream until exhausted or the character limit is exceeded and store results in a String.


Constructor Summary
StringInputStreamSink(java.lang.String tag, java.io.InputStream in, int maxChars)
          Creates a new instance.
 
Method Summary
 java.lang.String getOutput()
          Return output lines if we are storing output in a string or null if storing to a file.
 void run()
          Reads from the input stream and stores output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringInputStreamSink

public StringInputStreamSink(java.lang.String tag,
                             java.io.InputStream in,
                             int maxChars)
Creates a new instance.

Parameters:
tag - A tag for this processor to help with logging
in - InputStream from which we read
maxChars - Maximum number of characters to read (0 = MAX_CHARS)
Method Detail

run

public void run()
Reads from the input stream and stores output. Terminates when the input stream ends.

Specified by:
run in interface InputStreamSink
Specified by:
run in interface java.lang.Runnable
See Also:
InputStreamSink.run()

getOutput

public java.lang.String getOutput()
Return output lines if we are storing output in a string or null if storing to a file.

Specified by:
getOutput in interface InputStreamSink
Returns:
Output line array.
See Also:
InputStreamSink.getOutput()