read
An access method that reads from the data buffer.
Declaration
virtual IOReturn read(
void *dstBuffer,
UInt32 *dstBufferSize,
UInt32 readOffset = 0);Parameters
- dstBuffer:
Pointer to the destination buffer.
- dstBufferSize:
Pointer to an integer containing the size of the destination buffer. And is overwritten by this method to the actual number of bytes copied to the destination buffer.
- readOffset:
An offset from the start of the source data buffer to begin reading.
Return Value
Returns kIOReturnSuccess on success, kIOReturnBadArgument if any of the arguments provided is invalid, kIOReturnNotReadable if read access is not permitted, or an error from the notification handler.
Overview
This method handles an external request to read from the data buffer and copy it to the destination buffer provided by the accessor. If notification is enabled, then the notification handler is called before the data buffer is copied to the destination buffer. The notification handler may use this opportunity to intervene and to update the contents of the data buffer.