ByteExtensions.SetBits Method ​
Definition ​
Sets a range of bits in a byte to the specified value.
c#
public static Byte SetBits(this Byte original, Byte value, int startInclusive, int endInclusive);Parameters ​
| Name | Type | Description |
|---|---|---|
original | Byte | The original byte value. |
value | Byte | The value to set in the bit range. |
startInclusive | Int32 | The zero-based start bit index, inclusive. |
endInclusive | Int32 | The zero-based end bit index, inclusive. |
Returns ​
A new byte with the specified bit range replaced by value.