ZStreamR_Memory Class Reference

A read stream that gets its data from normal memory. More...

#include <ZStream_Memory.h>

Inheritance diagram for ZStreamR_Memory:

ZStreamR List of all members.

Public Member Functions

 ZStreamR_Memory (const void *iAddress)
virtual void Imp_CopyToDispatch (const ZStreamW &iStreamW, uint64 iCount, uint64 *oCountRead, uint64 *oCountWritten)
 Invoke iStreamW's Imp_CopyFrom method.
virtual void Imp_CopyTo (const ZStreamW &iStreamW, uint64 iCount, uint64 *oCountRead, uint64 *oCountWritten)
 Actually copy data from this stream to iStreamW.
virtual void Imp_Skip (uint64 iCount, uint64 *oCountSkipped)
 Read and discard iCount bytes.
const void * GetCurrentAddress ()
 Returns the address from which the next read would be satisfied.

Detailed Description

A read stream that gets its data from normal memory.

ZStreamR_Memory provides read stream access to normal memory. The memory is only referenced by the stream, no copy of it is taken, and no attempt is made to dispose it or otherwise interpret what kind of memory it might be. Access to the memory is unbounded. If you need to be able to set a limit on the range of bytes accessed, use ZStreamRPos_Memory.

See also:
ZStreamRPos_Memory


Constructor & Destructor Documentation

ZStreamR_Memory::ZStreamR_Memory ( const void *  iAddress  ) 

Parameters:
iAddress The address from which to start reading data.


Member Function Documentation

void ZStreamR_Memory::Imp_CopyToDispatch ( const ZStreamW iStreamW,
uint64  iCount,
uint64 oCountRead,
uint64 oCountWritten 
) [virtual]

Invoke iStreamW's Imp_CopyFrom method.

The first part of the two-stage dispatch initiated by ZStreamR::CopyTo and ZStreamR::CopyAllTo. Override this method if your stream's data is in memory and thus can be written to iStreamW by a single call to its Write method.

Reimplemented from ZStreamR.

void ZStreamR_Memory::Imp_CopyTo ( const ZStreamW iStreamW,
uint64  iCount,
uint64 oCountRead,
uint64 oCountWritten 
) [virtual]

Actually copy data from this stream to iStreamW.

The second part of the two-stage dispatch initiated by ZStreamW::CopyFrom and ZStreamW::CopyAllFrom. The default implementation calls sCopyReadToWrite. Override this method if your stream's data is in memory and thus can be written to iStreamW by a single call to its Write method.

See also:
sCopyReadToWrite

Reimplemented from ZStreamR.

void ZStreamR_Memory::Imp_Skip ( uint64  iCount,
uint64 oCountSkipped 
) [virtual]

Read and discard iCount bytes.

Override this method if your stream implementation can skip past bytes in the stream without actually reading them.

Parameters:
iCount Count of bytes to be skipped.
oCountSkipped Number of bytes that were actually skipped. If iCount is non zero and oCountSkipped is set to zero then this indicates that the stream has reached its end.

Reimplemented from ZStreamR.


The documentation for this class was generated from the following files:
Generated on Thu Jul 26 11:22:03 2007 for ZooLib by  doxygen 1.4.7