title: Android Kotlin equivalent of Swift Data(bytes)
body: <p>I have the following code in Swift 5:</p>
  <pre class="lang-swift prettyprint-override"><code>var value1: UInt64 = 9982738475723   
  var value2 = UInt32(truncatingIfNeeded: value1)
  let bytes = Data(bytes: &amp;value2, count: MemoryLayout.size(ofValue: value2))
  </code></pre>
  <p>What is the Android Kotlin equivalent of this swift data(bytes operation? Basically I am trying to convert UInt32 and UInt64 values to bytes arrays in Android. As an iOS developer it is not easy for me to code in Android so thanks for your help.</p>