title: How to convert String to Byte Array in iOS module of Kotlin Multiplatform project?
body: <p>This is my first experiment of Kotlin Multiplatform and it seems that I've not got some pieces completely. </p>
  
  <p>My backend sends a notification message via socket in UDP Multicast (I probably need to implement this part per platform as I don't think Kotlin does it for me). Then I want to pass this message (which in form of Byte Array) to my common module. This module is responsible to parse the message and return result to platforms.</p>
  
  <p>Just to simplify my work, I want each platform to return ByteArray of <code>test</code> message.</p>
  
  <p>This is my <code>common.kt</code> file:</p>
  
  <pre><code>package org.kotlin.mpp.mobile
  
  expect fun receivedEASNotification(): ByteArray
  
  fun parseEASNotification(msg: ByteArray) {
    // Use receivedEASNotification()
  }
  </code></pre>
  
  <p>This is Android file:</p>
  
  <pre><code>package org.kotlin.mpp.mobile
  
  actual fun receivedEASNotification(): ByteArray {
    return "test".toByteArray(Charsets.UTF_8)
  }
  </code></pre>
  
  <p>My problem is in <code>iOS</code> part. I can't realize how to convert string to ByteArray. There is <code>toCharArray()</code> function but not <code>toByteArray()</code>. Also, there is <code>toByte()</code> function.</p>
  
  <pre><code>actual fun receivedEASNotification(): ByteArray {
    return "test".toByteArray() // There is no such a function for iOS.
  }
  </code></pre>