public static void Main()
int[] intArray = new int[] { 32, 64, 80, 160, 192, 208, 33, 65, 81, 161, 193, 209, 33};
foreach(int temp in intArray)
string vehicleClassIdBinary2 = Convert.ToString(temp, 2);
char[] myArr = vehicleClassIdBinary2.ToCharArray();
Console.WriteLine("----------------------------------------");
Console.WriteLine("Eight bits : " + new string(myArr));
string reversedEightBitsRepresentation = new string(myArr);
reversedEightBitsRepresentation = reversedEightBitsRepresentation.PadLeft(8, '0');
string fourLastBits = reversedEightBitsRepresentation.Substring(reversedEightBitsRepresentation.Length - 4);
Console.WriteLine("Original int value : " + Convert.ToInt32(vehicleClassIdBinary2, 2));
Console.WriteLine("Reversed eight bits : " + reversedEightBitsRepresentation);
Console.WriteLine("Last 4 bits : " + fourLastBits);
Console.WriteLine("Last 4 bits converted to int : " + Convert.ToInt32(fourLastBits, 2));
Console.WriteLine("----------------------------------------");