operator & method

Byte operator &(
  1. Byte other
)

Bitwise AND operation.

Example:

final a = Byte(0x0F);  // 00001111
final b = Byte(0x33);  // 00110011
final result = a & b;  // 00000011 = 3
print(result.value);   // 3

Implementation

Byte operator &(Byte other) {
  if (!isSingleByte || !other.isSingleByte) {
    throw NoGuaranteeException('Bitwise operations only supported for single bytes');
  }
  return Byte(_bytes[0] & other._bytes[0]);
}