Package org.sentrysoftware.jawk.jrt
Class DataPump
java.lang.Object
org.sentrysoftware.jawk.jrt.DataPump
- All Implemented Interfaces:
Runnable
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).
- Author:
- Danny Daglas
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
dump
(String desc, InputStream in, PrintStream out) Allocate the data pump and start the thread.final void
run()
VM entry point for the thread.
-
Constructor Details
-
DataPump
Represents a data pump.- Parameters:
in
- The input stream.out
- The output stream.
-
-
Method Details
-
dump
Allocate the data pump and start the thread.- Parameters:
desc
- A human-readable description of this data pump. It is part of the thread name, and, therefore, visible upon a VM thread dump.in
- The input stream.out
- The output stream.
-
run
public final void run()VM entry point for the thread. It performs the data relay.
-