Method SetBits
SetBits(int, bool)
Sets a single bit to 1 or 0.
Declaration
public void SetBits(int pos, bool value)
Parameters
Type | Name | Description |
---|---|---|
int | pos | Position in this bit field to set (must be 0-31). |
bool | value | If true, sets the bit to 1. If false, sets the bit to 0. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |
SetBits(int, bool, int)
Sets one or more contiguous bits to 1 or 0.
Declaration
public void SetBits(int pos, bool value, int numBits)
Parameters
Type | Name | Description |
---|---|---|
int | pos | Position in the bit field of the first bit to set (must be 0-31). |
bool | value | If true, sets the bits to 1. If false, sets the bits to 0. |
int | numBits | Number of bits to set (must be 1-32). |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |