getBytesNoCopy(unsigned int, unsigned int)
Returns a pointer into the OSData object's internal data buffer with a given offset and length.
Declaration
virtual const void * getBytesNoCopy(
unsigned intstart,
unsigned intnumBytes) const;Parameters
- start:
The offset from the base of the internal data buffer.
- numBytes:
The length of the window.
Return Value
A pointer to the bytes in the specified range within the OSData object, or 0 if that range does not lie completely within the object's buffer.
Overview
You can modify the existing contents of an OSData object via this function. It works with OSData objects that have their own data buffers as well as with OSData objects that have shared buffers.
If you append bytes or characters to an OSData object, it may have to reallocate its internal storage, rendering invalid an extrated pointer to that storage.
See Also
Miscellaneous
appendByteappendBytes(const OSData *)appendBytes(const void *, unsigned int)ensureCapacityfreegetBytesNoCopy()getCapacitygetCapacityIncrementgetLengthinitWithBytesinitWithBytesNoCopyinitWithCapacityinitWithData(const OSData *)initWithData(const OSData *, unsigned int, unsigned int)isEqualTo(const OSData *)isEqualTo(const OSMetaClassBase *)isEqualTo(const OSString *)isEqualTo(const void *, unsigned int)serializesetCapacityIncrementwithByteswithBytesNoCopywithCapacitywithData(const OSData *)withData(const OSData *, unsigned int, unsigned int)