*** 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 -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()byte[]getData()Get the data of this InputStream.byte[]getData(boolean closeStream) Get the data of this InputStream.StringGet the data of this InputStream.StringgetDataAsString(String encoding, boolean closeStream) Get the data of this InputStream.com.sas.io.InputStreamHeaderInterfaceGet the header interface for this InputStream.intread()intread(byte[] b) intread(byte[] b, int off, int len) longskip(long n) Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferToMethods 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:
-
getData
public byte[] getData() throws IOExceptionGet 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 IOExceptionGet 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:
skipin classInputStream- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException - Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException - Overrides:
readin classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-