PDA

View Full Version : IL 1.1.2 Content pipe Read API



mgao
01-17-2011, 10:04 PM
Is there any particular reason that the Read API is defined without a mean to return the number of bytes actually read?

CPresult (*Read)(
CPhandle hContent,
CPbyte *pData,
CPuint nSize);

This makes API not being able to support partial read while using user supplied buffer, I would propose a trivial revision to,

CPresult (*Read)(
CPhandle hContent,
CPbyte *pData,
CPuint * nSize);

Similar to that of ReadBuffer, can any one comment on this?

Regards,

/MG

mgao
01-17-2011, 10:19 PM
The similar is true to the Write API.

One thing I can think of is 'slight' performance hit (by internally in the API updating the byte count), but the benefit seems well override the incompleteness of API, since without being able to support partial reading/writing, it leaves API quite not usable when considering retrieving data at the end of content, or writing with multiple attempts.

Thanks,

/MG