is there a simple way to convert a `Long` to `Byte...
# announcements
l
is there a simple way to convert a
Long
to
ByteArray
? I found some solutions on StackOverflow ect but they are pretty messy
b
Copy code
fun Long.toByteArray() = ByteBuffer.allocate(8).putLong(this).array()
does it simple for you?
l
I guess it doesnt get any simpler than that. thanks