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

com.sas.iom
Class InputStream

com.sas.iom.InputStream
All Implemented Interfaces:
java.io.Closeable

public class InputStream

Provides the capability to read input from an IOM InputStream.

Since:
1.0

Constructor Summary
InputStream(com.sas.iom.SASCache.ICacheReader iCacheReader, com.sas.iom.SASCache.ICacheService iCacheService)
           
 
Method Summary
 int available()
           
 void close()
           
 byte[] getData()
          Get the data of this InputStream.
 byte[] getData(boolean closeStream)
          Get the data of this InputStream.
 java.lang.String getDataAsString()
          Get the data of this InputStream.
 java.lang.String getDataAsString(java.lang.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)
           
 

Constructor Detail

InputStream

public InputStream(com.sas.iom.SASCache.ICacheReader iCacheReader,
                   com.sas.iom.SASCache.ICacheService iCacheService)
Method Detail

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 java.io.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:
java.io.IOException

getData

public byte[] getData(boolean closeStream)
               throws java.io.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:
java.io.IOException

getDataAsString

public java.lang.String getDataAsString()
                                 throws java.io.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:
java.io.IOException

getDataAsString

public java.lang.String getDataAsString(java.lang.String encoding,
                                        boolean closeStream)
                                 throws java.io.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:
java.io.IOException

skip

public long skip(long n)
          throws java.io.IOException
Overrides:
skip in class java.io.InputStream
Throws:
java.io.IOException

read

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

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

available

public int available()
              throws java.io.IOException
Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException

close

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

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.