Skip to content

ByteExtensions.SetBits Method

Definition

Sets a range of bits in a byte to the specified value.

public static Byte SetBits(this Byte original, Byte value, int startInclusive, int endInclusive);

View source

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

Byte

A new byte with the specified bit range replaced by value.