Package fr.gouv.vitam.common.stream

# Class LazySequenceInputStream

java.lang.Object
java.io.InputStream
fr.gouv.vitam.common.stream.LazySequenceInputStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public class LazySequenceInputStream extends InputStream
A `SequenceInputStream`-like implementation with lazy input stream iterator. An input stream in the iterator is initialized and consumed only when the previous input stream is fully consumed.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LazySequenceInputStream(Iterator<InputStream> lazyInputStreamIterator)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `available()`
  `void`
  `close()`
  `int`
  `read()`
  `int`
  `read(byte[] b)`
  `int`
  `read(byte[] b, int off, int len)`

  ### Methods inherited from class java.io.InputStream

  `mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### LazySequenceInputStream

    public LazySequenceInputStream(Iterator<InputStream> lazyInputStreamIterator)
    Constructor
    Parameters:
      `lazyInputStreamIterator` - an iterator that provides next input streams to chain

- ## Method Details

  - ### read

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

  - ### read

    public int read(byte[] b) throws IOException
    Overrides:
      `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`

  - ### close

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