### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.iom

# Class InputStream

java.lang.Object
java.io.InputStream
com.sas.iom.InputStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

@SASScope("ALL") @BinaryCompatibilityOnly public class InputStream extends InputStream
Provides the capability to read input from an IOM InputStream.

Since:
  1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InputStream(ICacheReader iCacheReader, ICacheService iCacheService)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `available()`
  `void`
  `close()`
  `byte[]`
  `getData()`
  Get the data of this InputStream.
  `byte[]`
  `getData(boolean closeStream)`
  Get the data of this InputStream.
  `String`
  `getDataAsString()`
  Get the data of this InputStream.
  `String`
  `getDataAsString(String encoding, boolean closeStream)`
  Get the data of this InputStream.
  `com.sas.io.InputStreamHeaderInterface`
  `getHeader()`
  Get the header interface for this InputStream.
  `int`
  `read()`
  `int`
  `read(byte[] b)`
  `int`
  `read(byte[] b, int off, int len)`
  `long`
  `skip(long n)`

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

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

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

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

- ## Constructor Details

  - ### InputStream

    public InputStream(ICacheReader iCacheReader, ICacheService iCacheService)

- ## Method Details

  - ### getHeader

    public com.sas.io.InputStreamHeaderInterface getHeader()
    Get the header interface for this InputStream.
    Returns:
      header InputStream header.
    See Also:
      - `InputStreamHeaderInterface`

  - ### getData

    public byte[] getData() throws IOException
    Get the data of this InputStream.

    This convenience method returns the entire contents of the InputStream as a byte array.

    The InputStream will be automatically closed when all the data has been read.

    Returns:
      data associated with this InputStream.
    Throws:
      `IOException`

  - ### getData

    public byte[] getData(boolean closeStream) throws IOException
    Get the data of this InputStream.

    This convenience method returns the entire contents of the InputStream as a byte array.

    Parameters:
      `closeStream` - set to true to cause the stream to be closed; otherwise false.
    Returns:
      data associated with this InputStream.
    Throws:
      `IOException`

  - ### getDataAsString

    public String getDataAsString() throws IOException
    Get the data of this InputStream.

    This convenience method returns the entire contents of the InputStream as a String.

    The default charset is used.

    The InputStream will be automatically closed when all the data has been read.

    Returns:
      data associated with this InputStream.
    Throws:
      `IOException`

  - ### getDataAsString

    public String getDataAsString(String encoding, boolean closeStream) throws IOException
    Get the data of this InputStream.

    This convenience method returns the entire contents of the InputStream as a String.

    Parameters:
      `encoding` - Name of a supported charset.
      `closeStream` - set to true to cause the stream to be closed; otherwise false.
    Returns:
      data associated with this InputStream.
    Throws:
      `IOException`

  - ### skip

    public long skip(long n) throws IOException
    Overrides:
      `skip` in class `InputStream`
    Throws:
      `IOException`

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