#include <cel_storage.h>
|
virtual size_t | readBytes (void *buffer, uint64_t inOffset, size_t inSize, bool wouldBlock=false)=0 |
|
This class defines an additional readBytes function, which accepts direct offset rather than reading from the current file pointer. Some variants of Storage implements this interface so that you can query the interface by using dynamic_cast
.
virtual size_t Celartem::BlockReadStorage::readBytes |
( |
void * |
buffer, |
|
|
uint64_t |
inOffset, |
|
|
size_t |
inSize, |
|
|
bool |
wouldBlock = false |
|
) |
| |
|
pure virtual |
readBytes tries to read bytes from the specified offset. If wouldBlock is false
, readBytes reads the data currenly available and returned immediately; the returned value indicates the bytes actually read and it is no more than inSize. If wouldBlock is true
, it blocks until it reads all the bytes specified by inSize parameter. If the stream is potentially read-only and it seems there're no chance to read the bytes specified by inSize, it throws some exception.
- Parameters
-
buffer | Pointer to a buffer that receives the data. |
inOffset | Absolute offset address to read from. |
inSize | Maximum size to read; readBytes reads data no more than the number of bytes specified by inSize. |
wouldBlock | It specifies it blocks until all bytes comes or not. |
- Returns
- readBytes returns the number of bytes read by this call.
The documentation for this class was generated from the following file: