pj
Class SubProcess.Copy

java.lang.Object
  extended by java.lang.Thread
      extended by pj.SubProcess.Copy
All Implemented Interfaces:
Runnable
Enclosing class:
SubProcess

public static class SubProcess.Copy
extends Thread

daemon thread to copy a stream to and from the subprocess. Copies characters if either stream requires it.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  InputStream byteIn
          source, maybe null.
protected  OutputStream byteOut
          target, maybe null.
protected  Reader charIn
          source, maybe null.
protected  Writer charOut
          target, maybe null.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SubProcess.Copy()
           
SubProcess.Copy(OutputStream byteOut)
           
SubProcess.Copy(Writer charOut)
           
 
Method Summary
 void copy()
          copy until end of file.
 void replaceFirst(String regex, String replacement)
          like copy() but perform exactly one string replacement.
 void run()
          execute copy().
 void setIn(InputStream byteIn)
          connects source.
 void setIn(Reader charIn)
          connects source.
 
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
 

Field Detail

charOut

protected Writer charOut
target, maybe null.


byteOut

protected OutputStream byteOut
target, maybe null.


charIn

protected Reader charIn
source, maybe null.


byteIn

protected InputStream byteIn
source, maybe null.

Constructor Detail

SubProcess.Copy

public SubProcess.Copy(Writer charOut)

SubProcess.Copy

public SubProcess.Copy(OutputStream byteOut)

SubProcess.Copy

public SubProcess.Copy()
Method Detail

setIn

public void setIn(Reader charIn)
connects source.


setIn

public void setIn(InputStream byteIn)
connects source.


copy

public void copy()
          throws IOException
copy until end of file.

Throws:
IOException

replaceFirst

public void replaceFirst(String regex,
                         String replacement)
                  throws IOException
like copy() but perform exactly one string replacement.

Throws:
IOException

run

public void run()
execute copy().

Specified by:
run in interface Runnable
Overrides:
run in class Thread