rcs.utils
Class CorrectedPipedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by rcs.utils.CorrectedPipedInputStream
All Implemented Interfaces:
java.io.Closeable

public class CorrectedPipedInputStream
extends java.io.InputStream

This class provides the same interface as java.io.PipedInputStream except that it corrects the problem that when java.io.PipedOutputStream has 1k or more written to it, it blocks until the some of the data is read from the input pipe before more can be written. CorrectedPipedInputStream/CorrectedPipedOutputStream only block for mutual exclusion but will allow any amount of data(atleast until you run out of memory) to be written to the pipe without waiting for a read.

 Related Documentation:
 RCS Library, NML Programmers Guide (Java Version)


 

See Also:
CorrectedPipedOutputStream

Field Summary
static boolean debug_on
           
 
Constructor Summary
CorrectedPipedInputStream()
           
CorrectedPipedInputStream(rcs.utils.CorrectedPipedOutputStreamInterface out)
           
 
Method Summary
 int available()
           
 void close()
           
 rcs.utils.CorrectedPipeData get_pipe_data()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.InputStream
mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug_on

public static final boolean debug_on
See Also:
Constant Field Values
Constructor Detail

CorrectedPipedInputStream

public CorrectedPipedInputStream()

CorrectedPipedInputStream

public CorrectedPipedInputStream(rcs.utils.CorrectedPipedOutputStreamInterface out)
Method Detail

get_pipe_data

public rcs.utils.CorrectedPipeData get_pipe_data()

available

public int available()
Overrides:
available in class java.io.InputStream

close

public void close()
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException