init(bytesNoCopy:length:freeWhenDone:)
Initializes a newly allocated data object by adding the given number of bytes from the given buffer.
Declaration
init(bytesNoCopy bytes: UnsafeMutableRawPointer, length: Int, freeWhenDone b: Bool)Parameters
- bytes:
A buffer containing data for the new object. If
flagis True,bytesmust point to a memory block allocated withmalloc. - length:
The number of bytes to hold from
bytes. This value must not exceed the length ofbytes. - b:
If True, the returned object takes ownership of the
bytespointer and frees it on deallocation.