Creates a data object that holds a given number of bytes from a given buffer.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
A buffer containing data for the new object.
bytesmust point to a memory block allocated with
The number of bytes to hold from
bytes. This value must not exceed the length of
The returned object takes ownership of the
bytes pointer and frees it on deallocation. Therefore,
bytes must point to a memory block allocated with