Initializer

init(bytesNoCopy:length:freeWhenDone:)

Initializes a newly allocated data object by adding to it length bytes of data from the buffer bytes.

Declaration

init(bytesNoCopy bytes: UnsafeMutableRawPointer, length: Int, freeWhenDone b: Bool)

Parameters

bytes

A buffer containing data for the new object. If flag is true, bytes must point to a memory block allocated with malloc.

length

The number of bytes to hold from bytes. This value must not exceed the length of bytes.

flag

If true, the returned object takes ownership of the bytes pointer and frees it on deallocation.