private static int MaskAndShiftRight(int value, uint mask, int shift) { return (int)((value & mask) >> shift); }