com.sap.portal.httpconnectivity.transformationservice.xmlsource

Class XMLSourceBufferedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.BufferedInputStream
              extended by com.sap.portal.httpconnectivity.transformationservice.xmlsource.XMLSourceBufferedInputStream
All Implemented Interfaces:
Closeable

public class XMLSourceBufferedInputStream
extends BufferedInputStream

A class used to buffer the data of the source stream so it can be cached. The data is stored when the input stream read methods are called.
Note: Used internally.


Field Summary
protected  com.sap.engine.lib.util.ArrayByte m_arrayByte
          The buffer that holds the data.
 
Fields inherited from class java.io.BufferedInputStream
buf, count, marklimit, markpos, pos
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
XMLSourceBufferedInputStream(InputStream is)
          The class constructor.
 
Method Summary
protected  com.sap.engine.lib.util.ArrayByte getByteBuffer()
          Gets the stored data from the input stream.
 int read()
          Reads one byte from the input stream and stores it in the buffer.
 int read(byte[] readBuf)
          Reads a number of bytes from the input stream and then stores them in the specified buffer array (readBuf) and in the cache buffer array (m_arrayByte).
 int read(byte[] readBuf, int off, int len)
          Reads up to len bytes of data from the input stream into the readBuf array of bytes and stores the bytes in the m_arrayByte buffer.
 
Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_arrayByte

protected com.sap.engine.lib.util.ArrayByte m_arrayByte
The buffer that holds the data.

Constructor Detail

XMLSourceBufferedInputStream

public XMLSourceBufferedInputStream(InputStream is)
The class constructor.

Parameters:
is - the buffered stream
Method Detail

getByteBuffer

protected com.sap.engine.lib.util.ArrayByte getByteBuffer()
Gets the stored data from the input stream.

Returns:
the data from the input stream

read

public int read()
         throws IOException
Reads one byte from the input stream and stores it in the buffer. -1 indicates there is no more data to read.

Overrides:
read in class BufferedInputStream
Returns:
the next byte of data
Throws:
IOException - if the operation fails

read

public int read(byte[] readBuf)
         throws IOException
Reads a number of bytes from the input stream and then stores them in the specified buffer array (readBuf) and in the cache buffer array (m_arrayByte). The number of bytes actually read is returned as an integer. This method repeats until input data is unavailable, an end of file is detected, or an exception is thrown.

Overrides:
read in class FilterInputStream
Parameters:
readBuf - the buffer into which the input stream data is read
Returns:
number the number of bytes read from the input stream
Throws:
IOException - if the operation fails

read

public int read(byte[] readBuf,
                int off,
                int len)
         throws IOException
Reads up to len bytes of data from the input stream into the readBuf array of bytes and stores the bytes in the m_arrayByte buffer. An attempt is made to read as many as len bytes, but a smaller number may be read, including zero bytes. The number of bytes actually read is returned as an integer; -1 indicates there is no more data to read.

Overrides:
read in class BufferedInputStream
Parameters:
readBuf - the buffer into which the input stream data is read
off - the start offset in array readBuf where the data is written
len - the maximum number of bytes to read
Returns:
the total number of bytes read into the buffer
Throws:
IOException - if the operation fails
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-ADMIN [sap.com] tc/ep/admin/api/extd api EP-PIN


Copyright 2011 SAP AG Complete Copyright Notice