insert

fun Int.insert(value: Int, offset: Int, count: Int): Int

Replaces this bits from offset to offset+count with value and returns the result of doing such replacement


fun Int.insert(value: Boolean, offset: Int): Int

Replaces 1 bit at offset with value and returns the result of doing such replacement