org.tinyjee.maven.dim.utils
Class CompositeInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.tinyjee.maven.dim.utils.CompositeInputStream
All Implemented Interfaces:
Closeable

public class CompositeInputStream
extends InputStream

Composites a given number of input streams.

Author:
Juergen_Kellerer, 2011-10-27

Constructor Summary
CompositeInputStream(Collection<InputStream> streams)
          Constructs a new stream out of the given streams.
CompositeInputStream(InputStream... streams)
          Constructs a new stream out of the given streams.
 
Method Summary
 void close()
           
 int read()
           
 int read(byte[] buffer, int off, int len)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeInputStream

public CompositeInputStream(Collection<InputStream> streams)
Constructs a new stream out of the given streams.

Parameters:
streams - the streams to composite.

CompositeInputStream

public CompositeInputStream(InputStream... streams)
Constructs a new stream out of the given streams.

Parameters:
streams - the streams to composite.
Method Detail

read

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

read

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

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException