title: How does NSData(bytes:length:) convert [Byte] to UnsafePointer<Void> in Swift?
body: <p>Playing with raw data in Swift I came across something I don't understand.<br>
  <strong>NSData</strong> has a constructor:</p>
  
  <pre><code>init(bytes: UnsafePointer&lt;Void&gt;, length: Int)
  </code></pre>
  
  <p>where the first <strong>bytes</strong> parameter is clearly of <strong>UnsafePointer</strong> type.<br>
  However, if I pass <strong>[Byte]</strong> object to this constructor, not only does the compiler not complain, but it works ok.<br>
  But if I try to cast <strong>[Byte]</strong> to <strong>UnsafePointer</strong>, I fail.<br>
  How does this work?</p>
  
  <p>For example (you can try it in Playgrounds):</p>
  
  <pre><code>let buffer: [Byte] = [0x00, 0xff]
  let data = NSData(bytes: buffer, length: buffer.count) // no error
  data.description
  
  var pointer: UnsafePointer&lt;Void&gt;
  // comment this line to avoid compiler error
  pointer = buffer // error
  </code></pre>
  
  <p>I know I can do</p>
  
  <pre><code>UnsafePointer&lt;Void&gt;(buffer)
  </code></pre>
  
  <p>but my question is, what does NSData constructor do implicitly, that I don't have to do that.</p>