class MemoryStream

A Stream that operates on DataBlocks in memory. More...

Full nameTelEngine::MemoryStream
Definition#include <yateclass.h>
InheritsTelEngine::Stream [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Members


Detailed Description

An implementation of a Stream that reads and writes data in a DataBlock

inline  MemoryStream ()

MemoryStream

Constructor of an empty stream

inline  MemoryStream (const DataBlock& data)

MemoryStream

Constructor of aan initialized stream

Parameters:
dataInitial data to be copied in the memory stream

inline const DataBlock&  data ()

data

[const]

Get read-only access to the DataBlock held

Returns: Const reference to the DataBlock

bool  terminate ()

terminate

[virtual]

Do-nothing termination handler

Returns: True to signal the stream was closed

Reimplemented from Stream.

bool  valid ()

valid

[const virtual]

Do-nothing validity check

Returns: True to indicate the stream is valid

Reimplemented from Stream.

int  writeData (const void* buffer, int len)

writeData

[virtual]

Write new data to the DataBlock at current position, advance pointer

Parameters:
bufferBuffer of source data
lenLength of data to be written

Returns: Number of bytes written, negative on error

Reimplemented from Stream.

int  readData (void* buffer, int len)

readData

[virtual]

Get data from internal DataBlock, advance pointer

Parameters:
bufferBuffer for getting the data
lenLength of the buffer

Returns: Number of bytes read, negative on error, zero on end of data

Reimplemented from Stream.

int64_t  length ()

length

[virtual]

Get the length of the stream

Returns: Length of the DataBlock in memory

Reimplemented from Stream.

int64_t  seek (SeekPos pos, int64_t offset = 0)

seek

[virtual]

Set the read/write pointer

Parameters:
posThe seek start as enumeration
offsetThe number of bytes to move the pointer from starting position

Returns: The new position of the stream read/write pointer. Negative on failure

Reimplemented from Stream.

DataBlock m_data

m_data

[protected]

int64_t m_offset

m_offset

[protected]


Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.