com.fasterxml.aalto.in

## Class MergedStream

- java.lang.Object
- - java.io.InputStream
  - - com.fasterxml.aalto.in.MergedStream

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public final class MergedStream
      extends InputStream

  Simple `InputStream` implementation that is used to "unwind" some data previously read from an input stream; so that as long as some of that data remains, it's returned; but as long as it's read, we'll just use data from the underlying original stream. This is similar to `PushbackInputStream`, but here there's only one implicit pushback, when instance is constructed.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MergedStream(ReaderConfig cfg, InputStream in, byte[] buf, int start, int end)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()`
    `void` | `close()`
    `void` | `mark(int readlimit)`
    `boolean` | `markSupported()`
    `int` | `read()`
    `int` | `read(byte[] b)`
    `int` | `read(byte[] b, int off, int len)`
    `void` | `reset()`
    `long` | `skip(long n)`

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

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

- - ### Constructor Detail

    - #### MergedStream

          public MergedStream(ReaderConfig cfg,
                      InputStream in,
                      byte[] buf,
                      int start,
                      int end)

  - ### Method Detail

    - #### available

          public int available()
                        throws IOException

      Overrides:
        `available` in class `InputStream`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `InputStream`
      Throws:
        `IOException`

    - #### mark

          public void mark(int readlimit)

      Overrides:
        `mark` in class `InputStream`

    - #### markSupported

          public boolean markSupported()

      Overrides:
        `markSupported` in class `InputStream`

    - #### 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`

    - #### reset

          public void reset()
                     throws IOException

      Overrides:
        `reset` in class `InputStream`
      Throws:
        `IOException`

    - #### skip

          public long skip(long n)
                    throws IOException

      Overrides:
        `skip` in class `InputStream`
      Throws:
        `IOException`

Copyright © 2012-2015 FasterXML. All Rights Reserved.