withBytes
Creates and initializes an instance of OSData with a copy of the provided data buffer.
Declaration
static OSData * withBytes(
const void *bytes,
unsigned intnumBytes);Parameters
- bytes:
The buffer of data to copy.
- numBytes:
The length of
bytes.
Return Value
An instance of OSData containing a copy of the provided byte array, with a reference count of 1; NULL on failure.
Overview
The new OSData object will grow as needed to accommodate more bytes (unlikeCFMutableData, for which a nonzero initial capacity is a hard limit).
See Also
Miscellaneous
appendByteappendBytes(const OSData *)appendBytes(const void *, unsigned int)ensureCapacityfreegetBytesNoCopy()getBytesNoCopy(unsigned int, unsigned int)getCapacitygetCapacityIncrementgetLengthinitWithBytesinitWithBytesNoCopyinitWithCapacityinitWithData(const OSData *)initWithData(const OSData *, unsigned int, unsigned int)isEqualTo(const OSData *)isEqualTo(const OSMetaClassBase *)isEqualTo(const OSString *)isEqualTo(const void *, unsigned int)serializesetCapacityIncrementwithBytesNoCopywithCapacitywithData(const OSData *)withData(const OSData *, unsigned int, unsigned int)