OSRTMemoryOutputStream Class Reference

#include <OSRTMemoryOutputStream.h>

Inheritance diagram for OSRTMemoryOutputStream:
OSRTOutputStream OSRTStream

List of all members.

Public Member Functions

EXTRTMETHOD OSRTMemoryOutputStream ()
EXTRTMETHOD OSRTMemoryOutputStream (OSOCTET *pMemBuf, size_t bufSize)
EXTRTMETHOD OSRTMemoryOutputStream (OSRTContext *pContext, OSOCTET *pMemBuf, size_t bufSize)
EXTRTMETHOD OSOCTET * getBuffer (size_t *pSize=0)
virtual OSBOOL isA (StreamID id) const
int reset ()

Detailed Description

Generic memory output stream. This class provides methods for streaming data to an output memory buffer.


Constructor & Destructor Documentation

EXTRTMETHOD OSRTMemoryOutputStream::OSRTMemoryOutputStream (  ) 

The default constructor initializes the memory output stream to use a dynamic memory output buffer. The status of the construction can be obtained by calling the getStatus method.

See also:
rtxStreamMemoryCreate
EXTRTMETHOD OSRTMemoryOutputStream::OSRTMemoryOutputStream ( OSOCTET *  pMemBuf,
size_t  bufSize 
)

Initializes the memory output stream using the specified memory buffer. The status of the construction can be obtained by calling the getStatus method.

Parameters:
pMemBuf The pointer to the buffer.
bufSize The size of the buffer.
See also:
rtxStreamMemoryAttach
EXTRTMETHOD OSRTMemoryOutputStream::OSRTMemoryOutputStream ( OSRTContext pContext,
OSOCTET *  pMemBuf,
size_t  bufSize 
)

Initializes the memory output stream using the specified memory buffer. The status of the construction can be obtained by calling the getStatus method.

Parameters:
pContext Pointer to a context to use.
pMemBuf The pointer to the buffer.
bufSize The size of the buffer.
See also:
rtxStreamMemoryAttach

Member Function Documentation

EXTRTMETHOD OSOCTET* OSRTMemoryOutputStream::getBuffer ( size_t *  pSize = 0  ) 

This method returns the address of the memory buffer to which data was written. If the buffer memory is dynamic, it may be freed using the rtxMemFreePtr function or it will be freed when the stream object is destroyed.

Parameters:
pSize Pointer to a size variable to receive the number of bytes written to the stream. This is an optional parameter, if a null pointer is passed, size is not returned.
Returns:
Pointer to memory buffer.
virtual OSBOOL OSRTMemoryOutputStream::isA ( StreamID  id  )  const [inline, virtual]

This method is used to query a stream object in order to determine its actual type.

Parameters:
id Enumerated stream identifier
Returns:
True if the stream matches the identifier

Reimplemented from OSRTOutputStream.

int OSRTMemoryOutputStream::reset (  ) 

This method resets the output memory stream internal buffer to allow it to be overwritten with new data. Memory for the buffer is not freed.

Returns:
Completion status of operation: 0 = success, negative return value is error.

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