Creates an XPC object representing buffer of bytes.
SDKs
- macOS 10.7+
- Mac Catalyst 13.0+
Framework
- XPC
Declaration
func xpc_data_create(_ bytes: Unsafe Raw Pointer?, _ length: Int) -> xpc _object _t
Parameters
bytes
The buffer of bytes which is to be boxed. You may create an empty data object by passing NULL for this parameter and 0 for the length. Passing NULL with any other length will result in undefined behavior.
length
The number of bytes which are to be boxed.
Return Value
A new data object.
Discussion
This method will copy the buffer given into internal storage. After calling this method, it is safe to dispose of the given buffer.