#include <DataIO.h>
Inheritance diagram for BMemoryIO:

BMemoryIO represents a buffer of memory.
BMemoryIO object upon construction.
Public Member Functions | |
| BMemoryIO (void *p, size_t len) | |
| BMemoryIO (const void *p, size_t len) | |
| virtual | ~BMemoryIO () |
| virtual ssize_t | ReadAt (off_t pos, void *buffer, size_t size) |
| virtual ssize_t | WriteAt (off_t pos, const void *buffer, size_t size) |
| virtual off_t | Seek (off_t pos, uint32 seek_mode) |
| virtual off_t | Position () const |
| virtual status_t | SetSize (off_t size) |
|
||||||||||||
|
The BMemoryIO constructor assigns the object a buffer p with at least len of available memory. |
|
||||||||||||
|
The BMemoryIO constructor assigns the object a buffer p with at least len of available memory. If the buffer is declared |
|
|
The BMemoryIO destructor does nothing. |
|
|
Implements BPositionIO. |
|
||||||||||||||||
|
Copies up to size bytes of data from the object into the buffer and returns the actual number of bytes placed in the buffer. The data is read beginning at the pos offset. This function doesn't read beyond the end of the data. If there are fewer than size of data available at the pos offset, it reads only through the last data byte and returns a smaller number than size. If pos is out of range, it returns 0. Implements BPositionIO. |
|
||||||||||||
|
Sets the position in the data buffer where the Read() and Write() functions (inherited from BPositionIO) begin reading and writing. How the pos argument is understood depends on the seek_mode flag. There are three modes:
Implements BPositionIO. |
|
|
Reimplemented from BPositionIO. |
|
||||||||||||||||
|
Copies size bytes of data from buffer into allocated memory beginning at pos, and returns the number of bytes written. WriteAt() won't write outside the memory buffer. If pos is beyond the end of the buffer, it returns 0. If the object is read-only, it returns B_NOT_ALLOWED. Implements BPositionIO. |