Skip to content

IOFileComponent.GetBits Method ​

Overloads ​

NameDescription
GetBits(Int32, Int32, Int32)Gets a range of bits from the byte at the specified index.
GetBits<TEnum>(Int32, Int32, Int32)Gets a range of bits from the byte at the specified index as an enum value.

GetBits(Int32, Int32, Int32) ​

Gets a range of bits from the byte at the specified index.

c#
protected Byte GetBits(int index, int startInclusive, int endInclusive);

View source

Parameters ​

NameTypeDescription
indexInt32The index of the byte.
startInclusiveInt32The start bit index, inclusive.
endInclusiveInt32The end bit index, inclusive.

Returns ​

Byte

The extracted bits as a byte.

GetBits<TEnum>(Int32, Int32, Int32) ​

Gets a range of bits from the byte at the specified index as an enum value.

c#
protected TEnum GetBits<TEnum>(int index, int startInclusive, int endInclusive)
   where TEnum : struct, Enum;

View source

Type Parameters ​

NameDescription
TEnumThe enum type.

Parameters ​

NameTypeDescription
indexInt32The index of the byte.
startInclusiveInt32The start bit index, inclusive.
endInclusiveInt32The end bit index, inclusive.

Returns ​

TEnum

The extracted bits as an enum value.