Returns a data object filled with a given number of bytes of data from a given buffer.
- iOS 2.0+
- macOS 10.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
A data object initialized by adding to it
length bytes of data from the buffer
bytes. The returned object might be different than the original receiver.
The returned object takes ownership of the
bytes pointer and frees it on deallocation. Therefore,
bytes must point to a memory block allocated with