Imagine I have a Kotlin program with a variable b of type Byte, into which an external system writes values greater than 127. \"External\"
b
Byte
127
Good old printf does what we want:
printf
java.lang.String.format("%02x", byte)