Yes, you can change it like ``` val tmp = ByteBuf...
# getting-started
s
Yes, you can change it like
Copy code
val tmp = ByteBuffer.allocate(4)
/**
 * @param i Int to convert to bytes
 * @param n Number of bytes to take
 */
fun intToBytes(i: Int, n:Int): ByteArray {
    tmp.clear()
    tmp.putInt(i)
    tmp.flip()
    val out = ByteArray(n)
    tmp.get(out, 0, n)
    return out
}