glassfrog.players
Class StreamConnect

java.lang.Object
  extended by glassfrog.players.StreamConnect
All Implemented Interfaces:
java.lang.Runnable

public class StreamConnect
extends java.lang.Object
implements java.lang.Runnable

If a program called by Process sends data to stdout which is not read, it blocks. This class allows you to connect stdout of a process to an inputstream


Field Summary
(package private)  java.io.InputStream is
          The stream to be read from.
(package private)  java.io.OutputStream os
          The stream to be written to.
 
Constructor Summary
StreamConnect(java.io.InputStream is, java.io.OutputStream os)
          Generate a new StreamConnect object.
 
Method Summary
 void run()
          A thread which takes bytes from the input stream to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

is

java.io.InputStream is
The stream to be read from. Usually, the stream from the process.


os

java.io.OutputStream os
The stream to be written to. Usually a file or stdout or stderr.

Constructor Detail

StreamConnect

public StreamConnect(java.io.InputStream is,
                     java.io.OutputStream os)
Generate a new StreamConnect object.

Parameters:
is - Input stream
os - Output stream
Method Detail

run

public void run()
A thread which takes bytes from the input stream to the output stream.

Specified by:
run in interface java.lang.Runnable