title: Creating ByteArray in Kotlin
body: <p>Is there a better/shorter way in creating byte array from constant hex than the version below?</p>
  
  <pre><code>byteArrayOf(0xA1.toByte(), 0x2E.toByte(), 0x38.toByte(), 0xD4.toByte(), 0x89.toByte(), 0xC3.toByte())
  </code></pre>
  
  <p>I tried to put <code>0xA1</code> without <code>.toByte()</code> but I receive <strong>syntax error</strong> complaint saying <code>integer literal does not conform to the expected type Byte</code>. Putting integer is fine but I prefer in hex form since my source is in hex string. Any hints would be greatly appreciated. Thanks!</p>