IFX_BufferRead stream provides an optimized approach to read stream data. Usually, one stream maintains an internal buffer for data access, this buffer can be used directly to caller, and avoids data-copy.
More...
IFX_BufferRead stream provides an optimized approach to read stream data. Usually, one stream maintains an internal buffer for data access, this buffer can be used directly to caller, and avoids data-copy.
◆ GetBlockBuffer()
virtual FX_LPCBYTE IFX_BufferRead::GetBlockBuffer |
( |
| ) |
|
|
pure virtual |
Get internal buffer of block data.
- Returns
- The internal buffer.
◆ GetBlockOffset()
virtual FX_INT64 IFX_BufferRead::GetBlockOffset |
( |
| ) |
|
|
pure virtual |
Get the offset of data in internal buffer.
This offset starts from the beginning of stream.
- Returns
- The offset of data in internal buffer.
◆ GetBlockSize()
virtual size_t IFX_BufferRead::GetBlockSize |
( |
| ) |
|
|
pure virtual |
Get the size of data in internal buffer.
- Returns
- Size of data in internal buffer.
◆ GetPosition()
virtual FX_INT64 IFX_BufferRead::GetPosition |
( |
| ) |
|
|
pure virtual |
Get the current reading position in stream.
- Returns
- Current reading position in stream.
Implements IFX_StreamRead.
◆ IsEOF()
virtual FX_BOOL IFX_BufferRead::IsEOF |
( |
| ) |
|
|
pure virtual |
Determine whether reach the end of stream.
- Returns
- TRUE means reach the end of stream, and FALSE means not yet.
Implements IFX_StreamRead.
◆ ReadBlock()
virtual size_t IFX_BufferRead::ReadBlock |
( |
void * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
pure virtual |
Read data block from sequential stream.
- Parameters
-
[in,out] | buffer | buffer to store data. |
[in] | size | total size of buffer, in bytes. |
- Returns
- The length of data stored in buffer. 0 means error or no data.
Implements IFX_StreamRead.
◆ ReadNextBlock()
Read the next block in sequential stream.
- Parameters
-
[in] | bRestart | Indicates to read data from the beginning of stream. Default value: FALSE. |
- Returns
- TRUE means success, and FALSE means failure.
◆ Release()
virtual void IFX_BufferRead::Release |
( |
| ) |
|
|
pure virtual |
Called when to release the current instance.
- Returns
- None.
Implements IFX_StreamRead.