AdvancedLauncher.Tools.Imaging.Utilities.GetBits C# (CSharp) Метод

GetBits() статический приватный Метод

Gets an int value representing the subset of bits from a single Byte.
Given -> b = 00110101 A call to GetBits(b, 2, 4) GetBits looks at the following bits in the byte -> 00{1101}00 Returns 1101 as an int (13)
static private GetBits ( byte b, int offset, int count ) : int
b byte The Byte used to get the subset of bits from.
offset int The offset of bits starting from the right.
count int The number of bits to read.
Результат int
        internal static int GetBits(byte b, int offset, int count)
        {
            return (b >> offset) & ((1 << count) - 1);
        }