A Stream that operates on DataBlocks in memory.
More...
#include <yateclass.h>
A Stream that operates on DataBlocks in memory.
An implementation of a Stream that reads and writes data in a DataBlock
Constructor of an empty stream
Constructor of aan initialized stream
- Parameters
-
data | Initial data to be copied in the memory stream |
virtual int64_t length |
( |
| ) |
|
|
inlinevirtual |
virtual int readData |
( |
void * |
buffer, |
|
|
int |
len |
|
) |
| |
|
virtual |
Get data from internal DataBlock, advance pointer
- Parameters
-
buffer | Buffer for getting the data |
len | Length of the buffer |
- Returns
- Number of bytes read, negative on error, zero on end of data
Implements Stream.
virtual int64_t seek |
( |
SeekPos |
pos, |
|
|
int64_t |
offset = 0 |
|
) |
| |
|
virtual |
Set the read/write pointer
- Parameters
-
pos | The seek start as enumeration |
offset | The 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.
virtual bool terminate |
( |
| ) |
|
|
inlinevirtual |
Do-nothing termination handler
- Returns
- True to signal the stream was closed
Implements Stream.
virtual bool valid |
( |
| ) |
const |
|
inlinevirtual |
Do-nothing validity check
- Returns
- True to indicate the stream is valid
Implements Stream.
virtual int writeData |
( |
const void * |
buffer, |
|
|
int |
len |
|
) |
| |
|
virtual |
Write new data to the DataBlock at current position, advance pointer
- Parameters
-
buffer | Buffer of source data |
len | Length of data to be written |
- Returns
- Number of bytes written, negative on error
Implements Stream.
The current position for read/write operation
The documentation for this class was generated from the following file: