initWithBytesNoCopy
Initializes an instance of OSData to share the provided data buffer.
Declaration
virtual bool initWithBytesNoCopy(
void *bytes,
unsigned intnumBytes);Parameters
- bytes:
The buffer of data to represent.
- numBytes:
The length of
bytes.
Return Value
true on success, false on failure.
Overview
Not for general use. Use the static instance creation method withBytesNoCopy instead.
An OSData object initialized with this function does not claim ownership of the data buffer, but merely shares it with the caller.
An OSData object created with shared external data cannot append bytes, but you can get the byte pointer and modify bytes within the shared buffer.
See Also
Miscellaneous
appendByteappendBytes(const OSData *)appendBytes(const void *, unsigned int)ensureCapacityfreegetBytesNoCopy()getBytesNoCopy(unsigned int, unsigned int)getCapacitygetCapacityIncrementgetLengthinitWithBytesinitWithCapacityinitWithData(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)