CFDataCreate(_:_:_:)
Creates an immutable CFData object using data copied from a specified byte buffer.
Declaration
func CFDataCreate(_ allocator: CFAllocator!, _ bytes: UnsafePointer<UInt8>!, _ length: CFIndex) -> CFData!Parameters
- allocator:
The allocator to use to allocate memory for the new object. Pass
NULLor kCFAllocatorDefault to use the current default allocator. - bytes:
A pointer to the byte buffer that contains the raw data to be copied into
theData. - length:
The number of bytes in the buffer (
bytes).
Return Value
A new CFData object, or NULL if there was a problem creating the object. Ownership follows the The Create Rule.
Discussion
You must supply a count of the bytes in the buffer. This function always copies the bytes in the provided buffer into internal storage.