How to copy [UInt8] array to C pointer in Swift 3?
<p>I'm trying to copy Swift <code>[UInt8]</code> buffer to a C pointer. I can't find the right solution, here is my code:</p>

<pre><code>uploadBodyBytes = [UInt8]()
...
...
var data = crl.uploadBodyBytes[crl.bodyBytesUploaded..&lt;crl.bodyBytesUploaded+actualLen]

_ = data.withUnsafeBytes({ (rawData /*provides UnsafeRawBufferPointer*/) -&gt; UnsafeMutableRawPointer in
    return memcpy(a, rawData /*expected UnsafeRawPointer*/, actualLen)
})
</code></pre>

<p><code>data.withUnsafeBytes</code> gives me <code>UnsafeRawBufferPointer</code> but that seems to be incompatible with <code>memcpy</code> which expects <code>UnsafeRawPointer</code>. </p>

<p>Help appreciated.</p>