Contents

xpc_data_create(_:_:)

Creates an XPC object that represents a buffer of bytes.

Declaration

func xpc_data_create(_ bytes: UnsafeRawPointer?, _ 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.

See Also

Data objects