com.aragost.javahg.internals
Class OutputChannelInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.aragost.javahg.internals.OutputChannelInputStream
All Implemented Interfaces:
Closeable

public class OutputChannelInputStream
extends InputStream

An input stream that will make everything written to the output channel for one command available as an input stream.

Reading from this stream will add to the ByteArrayOutputStream for the other channels, as blocks for other channels are detected.

The stream will indicate EOF when the 'r'esult block has been read.

If a 'L' block is read it will also indicate EOF. After a respond to the 'L' block is sent to the server, you can call reopen() and read the rest of the input.


Method Summary
 int available()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void reopen()
          Reopen this stream to read pending 'o' blocks.
 
Methods inherited from class java.io.InputStream
close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

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

read

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

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

reopen

public void reopen()
Reopen this stream to read pending 'o' blocks.

The stream is indicating EOF when an 'L' block is encountered. With this method the rest of the rest of the 'o' blocks can be read.



Copyright © 2011-2013 aragost Trifork ag. All Rights Reserved.