private bool GetBit(byte input, byte position) { bool ret = false; int mask = (0x80 >> (int)position); int masked = (int)input & mask; int shifted = masked >> 7 - (int)position; ret = (1 == shifted) ? true : false; return ret; }