com.jaxfront.core.util.io
Class CombinedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.jaxfront.core.util.io.CombinedInputStream
All Implemented Interfaces:
java.io.Closeable

public class CombinedInputStream
extends java.io.InputStream

Reads multiple Inputstreams as one


Constructor Summary
CombinedInputStream(java.io.InputStream[] streams)
          Constructs an combined InputStream, that reads from array stream per stream, till the last stream
 
Method Summary
 int available()
          Is there more data to read
 void close()
          Closes all streams
 int read()
          Reads from the list of streams, when the last stream is over, -1 will be returned (as usual)
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinedInputStream

public CombinedInputStream(java.io.InputStream[] streams)
Constructs an combined InputStream, that reads from array stream per stream, till the last stream

Parameters:
streams - All Streams that will be combined
Method Detail

available

public int available()
              throws java.io.IOException
Is there more data to read

Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes all streams

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Reads from the list of streams, when the last stream is over, -1 will be returned (as usual)

Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException