org.jawk.jrt
Class DataPump

java.lang.Object
  extended by java.lang.Thread
      extended by org.jawk.jrt.DataPump
All Implemented Interfaces:
java.lang.Runnable

public class DataPump
extends java.lang.Thread

Relay data from an input stream to an output stream. A thread is created to do the work.

Jawk uses data pumps to relay stdin, stdout, and stderr of a spawned process (by, for example, system() or "cmd" | getline) to the stdin, stdout, and/or stderr of the calling process (the interpreter itself).


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
DataPump(java.lang.String s, java.io.InputStream is, java.io.PrintStream os)
          Allocate the data pump and start the thread.
 
Method Summary
 void run()
          VM entry point for the thread.
 
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

DataPump

public DataPump(java.lang.String s,
                java.io.InputStream is,
                java.io.PrintStream os)
Allocate the data pump and start the thread.

Parameters:
s - A human-readable description of this data pump. It is part of the thread name, and, therefore, visible upon a VM thread dump.
is - The input stream.
os - The output stream.
Method Detail

run

public final void run()
VM entry point for the thread. It performs the data relay.

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