OSRTInputStreamIF Class Reference
[Generic Input Stream Classes]

Inheritance diagram for OSRTInputStreamIF:

OSRTStreamIF OSRTCtxtHolderIF OSRTInputStream OSBufferedInputStream OSRTFileInputStream OSRTMemoryInputStream OSRTSocketInputStream List of all members.

Public Member Functions

virtual EXTRTMETHOD ~OSRTInputStreamIF ()
 Virtual destructor.
virtual size_t currentPos ()=0
 This method returns the current position in the stream (in octets).
virtual OSBOOL markSupported ()=0
 Tests if this input stream supports the mark and reset methods.
virtual int mark (size_t readAheadLimit)=0
 This method marks the current position in this input stream.
virtual long read (OSOCTET *pDestBuf, size_t maxToRead)=0
 Read data from the stream.
virtual long readBlocking (OSOCTET *pDestBuf, size_t toReadBytes)=0
 Read data from the stream.
virtual int reset ()=0
 Repositions this stream to the position at the time the mark method was last called on this input stream.
virtual int skip (size_t n)=0
 Skips over and discards the specified amount of data octets from this input stream.

Detailed Description

Definition at line 43 of file OSRTInputStreamIF.h.


Constructor & Destructor Documentation

virtual EXTRTMETHOD OSRTInputStreamIF::~OSRTInputStreamIF (  )  [virtual]

Virtual destructor.

Closes the stream if it was opened.


Member Function Documentation

virtual size_t OSRTInputStreamIF::currentPos (  )  [pure virtual]

This method returns the current position in the stream (in octets).

Returns:
The number of octets already read from the stream.

Implemented in OSRTInputStream.

virtual OSBOOL OSRTInputStreamIF::markSupported (  )  [pure virtual]

Tests if this input stream supports the mark and reset methods.

Whether or not mark and reset are supported is an invariant property of a particular input stream instance. By default, it returns FALSE.

Returns:
TRUE if this stream instance supports the mark and reset methods; FALSE otherwise.
See also:
rtxStreamIsMarkSupported

Implemented in OSRTInputStream.

virtual int OSRTInputStreamIF::mark ( size_t  readAheadLimit  )  [pure virtual]

This method marks the current position in this input stream.

A subsequent call to the reset method repositions this stream at the last marked position so that subsequent reads re-read the same bytes. The readAheadLimit argument tells this input stream to allow that many bytes to be read before the mark position gets invalidated.

Parameters:
readAheadLimit the maximum limit of bytes that can be read before the mark position becomes invalid.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamMark, rtxStreamReset

Implemented in OSRTInputStream.

virtual long OSRTInputStreamIF::read ( OSOCTET *  pDestBuf,
size_t  maxToRead 
) [pure virtual]

Read data from the stream.

This method reads up to maxToRead bytes from the stream. It may return a value less then this if the mamimum number of bytes is not available.

Parameters:
pDestBuf Pointer to a buffer to receive a data.
maxToRead Size of the buffer.
Returns:
The total number of octets read into the buffer, or negative value with error code if any error is occurred.
See also:
rtxStreamRead

Implemented in OSRTInputStream.

virtual long OSRTInputStreamIF::readBlocking ( OSOCTET *  pDestBuf,
size_t  toReadBytes 
) [pure virtual]

Read data from the stream.

This method reads up to maxToRead bytes from the stream. It may return a value less then this if the mamimum number of bytes is not available.

Parameters:
pDestBuf Pointer to a buffer to receive a data.
toReadBytes Number of bytes to be read.
Returns:
The total number of octets read into the buffer, or negative value with error code if any error is occurred.
See also:
rtxStreamRead

Implemented in OSRTInputStream.

virtual int OSRTInputStreamIF::reset (  )  [pure virtual]

Repositions this stream to the position at the time the mark method was last called on this input stream.

Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamMark, rtxStreamReset

Implemented in OSRTInputStream.

virtual int OSRTInputStreamIF::skip ( size_t  n  )  [pure virtual]

Skips over and discards the specified amount of data octets from this input stream.

Parameters:
n The number of octets to be skipped.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamSkip

Implemented in OSRTInputStream.


The documentation for this class was generated from the following file: