hasAllBitsSet

infix fun Byte.hasAllBitsSet(mask: Int): Boolean
infix fun UByte.hasAllBitsSet(mask: Int): Boolean

Returns whether ALL bits that are equal to 1 in the given mask are also set to 1 in the receiver.

Example:

  • 0b00001111 hasAllBitsSet 0b00000111 == true

  • 0b00001111 hasAllBitsSet 0b00001000 == true

  • 0b10101010 hasAllBitsSet 0b00000100 == false

  • 0b10101000 hasAllBitsSet 0b10101010 == false

  • 0b10101010 hasAllBitsSet 0b10000000 == true

Receiver

Byte value.