fromByteArray
Creates a uuid from a byte array containing 128 bits split into 16 bytes.
Each byte in the byteArray sequentially represents the next 8 bits of the uuid, starting from the most significant 8 bits in the first byte to the least significant 8 bits in the last byte.
Since Kotlin
2.0Return
A new uuid based on the specified bits.
Parameters
byteArray
A 16-byte array containing the uuid bits.
See also
Throws
If the size of the byteArray is not exactly 16.
Samples
import kotlin.uuid.*
fun main() {
//sampleStart
val byteArray = byteArrayOf(
0x55, 0x0e, 0x84.toByte(), 0x00, 0xe2.toByte(), 0x9b.toByte(), 0x41, 0xd4.toByte(),
0xa7.toByte(), 0x16, 0x44, 0x66, 0x55, 0x44, 0x00, 0x00
)
val uuid = Uuid.fromByteArray(byteArray)
println(uuid) // 550e8400-e29b-41d4-a716-446655440000
//sampleEnd
}