org.jwarp.util.io
Class MergedInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.jwarp.util.io.MergedInputStream

public class MergedInputStream
extends java.io.InputStream

Merges some input streams into one.

Author:
Anatole Tresch

Field Summary
protected  int curindex
          The current input stream index
protected  java.io.InputStream[] streams
          The several input streams
 
Constructor Summary
MergedInputStream(java.io.InputStream[] inputStreams)
          Creates a new merged input stream instance containing the streams given by the array.
 
Method Summary
 int read()
          Read from the stream.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

streams

protected final java.io.InputStream[] streams
The several input streams

curindex

protected int curindex
The current input stream index
Constructor Detail

MergedInputStream

public MergedInputStream(java.io.InputStream[] inputStreams)
Creates a new merged input stream instance containing the streams given by the array.
Parameters:
inputStream - The input streams
Method Detail

read

public int read()
         throws java.io.IOException
Read from the stream. This reads out the data from the containing input stream. If the current internal input stream is empty the next just will be read out until all internal input streams are read.
Overrides:
read in class java.io.InputStream
Returns:
The number of bytes read.

©   O R C A   S y s t e m s