Skip to content

ByteExtensions.GetBits Method ​

Definition ​

Gets a range of bits from a byte, shifted down to the least significant position.

c#
public static Byte GetBits(this Byte value, int startInclusive, int endInclusive);

View source

Parameters ​

NameTypeDescription
valueByteThe byte value.
startInclusiveInt32The zero-based start bit index, inclusive.
endInclusiveInt32The zero-based end bit index, inclusive.

Returns ​

Byte

The extracted bits, shifted right so the start bit is at position 0.