FDO API Reference Feature Data Objects
Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FdoIoMemoryStream Class Reference

#include <MemoryStream.h>

Inherits FdoIoStream.

Inheritance diagram for FdoIoMemoryStream:

[legend]
List of all members.

Detailed Description

FdoIoMemoryStream provides streamed I/O to and from memory.

Definition at line 28 of file MemoryStream.h.


Public Member Functions

virtual FDO_API_COMMON FdoInt64 GetIndex ()
 gets the current position for the stream.
virtual FDO_API_COMMON FdoInt64 GetLength ()
 gets the current length of the stream.
virtual FDO_API_COMMON FdoSize Read (FdoByte *buffer, FdoSize count)
 reads the number of bytes indicated by count into the given buffer, or the number of bytes after the current stream position, whichever is less. The stream’s current position is moved ahead by the number of bytes read.
virtual FDO_API_COMMON void Reset ()
 sets the position to the start of the stream.
virtual FDO_API_COMMON void SetLength (FdoInt64 length)
 truncates the stream to the indicated length.
virtual FDO_API_COMMON void Skip (FdoInt64 offset)
 skips over part of the stream.
virtual FDO_API_COMMON void Write (FdoIoStream *stream, FdoSize count=0)
 reads the number of bytes from the given stream, and writes them to this stream.
virtual FDO_API_COMMON void Write (FdoByte *buffer, FdoSize count)
 writes the number of bytes indicated by count, from the given buffer, to the stream. The current position is moved ahead by the number of bytes written.

Static Public Member Functions

FDO_API_COMMON FdoIoMemoryStreamCreate (FdoSize bufferSize=4096)
 creates the memory stream. The stream manages its own storage.

Protected Member Functions

 FdoIoMemoryStream (FdoSize bufferSize=4096)
 DOXYGEN-IGNORE
void GetBufPosn (FdoSize &bufNum, FdoSize &bufOffset)
virtual ~FdoIoMemoryStream (void)

Constructor & Destructor Documentation

FdoIoMemoryStream::FdoIoMemoryStream FdoSize  bufferSize = 4096  )  [protected]
 

DOXYGEN-IGNORE

virtual FdoIoMemoryStream::~FdoIoMemoryStream void   )  [protected, virtual]
 


Member Function Documentation

FDO_API_COMMON FdoIoMemoryStream* FdoIoMemoryStream::Create FdoSize  bufferSize = 4096  )  [static]
 

creates the memory stream. The stream manages its own storage.

Parameters:
bufferSize Input memory allocation increment. Amount of new memory to allocated when the stream needs more memory.
Returns:
Returns the created memory stream.

void FdoIoMemoryStream::GetBufPosn FdoSize bufNum,
FdoSize bufOffset
[protected]
 

virtual FDO_API_COMMON FdoInt64 FdoIoMemoryStream::GetIndex  )  [inline, virtual]
 

gets the current position for the stream.

Returns:
Returns the position in bytes from the start. When 0, the the position is at the start of the stream. When GetIndex() == GetLength() the position is at the end of the stream.

Implements FdoIoStream.

Definition at line 52 of file MemoryStream.h.

References FDO_API_COMMON, and FdoInt64.

virtual FDO_API_COMMON FdoInt64 FdoIoMemoryStream::GetLength  )  [inline, virtual]
 

gets the current length of the stream.

Returns:
Returns the length in bytes. Returns -1 if the length is unknown or undefined.

Implements FdoIoStream.

Definition at line 48 of file MemoryStream.h.

References FDO_API_COMMON, and FdoInt64.

virtual FDO_API_COMMON FdoSize FdoIoMemoryStream::Read FdoByte buffer,
FdoSize  count
[virtual]
 

reads the number of bytes indicated by count into the given buffer, or the number of bytes after the current stream position, whichever is less. The stream’s current position is moved ahead by the number of bytes read.

Parameters:
buffer Output read into this buffer
count Input read this number of bytes into the buffer. The caller is responsible for allocating a buffer that is large enough to hold the bytes.
Returns:
Returns the number of bytes that were read. 0 if already at the end of the stream.

Implements FdoIoStream.

virtual FDO_API_COMMON void FdoIoMemoryStream::Reset  )  [virtual]
 

sets the position to the start of the stream.

Implements FdoIoStream.

virtual FDO_API_COMMON void FdoIoMemoryStream::SetLength FdoInt64  length  )  [virtual]
 

truncates the stream to the indicated length.

Parameters:
length Input the new length (in bytes) for the stream. If this is longer than the current stream length then the stream's length is not changed.

Implements FdoIoStream.

virtual FDO_API_COMMON void FdoIoMemoryStream::Skip FdoInt64  offset  )  [virtual]
 

skips over part of the stream.

Parameters:
offset The number of bytes to skip. if positive then the current position is moved forward. If negative, the position is moved backward. The position will remain between the start and end of the stream. The position is set to the end of the stream if the given offset would put it past the end. Similarily, the position is set to the start if the offset would put it before the start.

Implements FdoIoStream.

virtual FDO_API_COMMON void FdoIoMemoryStream::Write FdoIoStream stream,
FdoSize  count = 0
[virtual]
 

reads the number of bytes from the given stream, and writes them to this stream.

Parameters:
stream Input write from this buffer
count Input the maximum number of bytes to read and write. When 0, all remaining bytes are read from the given stream.

Implements FdoIoStream.

virtual FDO_API_COMMON void FdoIoMemoryStream::Write FdoByte buffer,
FdoSize  count
[virtual]
 

writes the number of bytes indicated by count, from the given buffer, to the stream. The current position is moved ahead by the number of bytes written.

Parameters:
buffer Intput write from this buffer
count Input number of bytes to write
Note:
Write will overwrite some of the contents of the stream if the current position is not at the end of the stream.

Implements FdoIoStream.


The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.