I have the following code in Swift 5:
var value1: UInt64 = 9982738475723
var value2 = UInt32(truncatingIfNeeded: value1)
let bytes = Data(bytes: &value2, count: MemoryLayout.size(ofValue: value2))
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.