public static void PrintPacket(byte[] packet) { ushort Length = BitConverter.ToUInt16(packet, 0); ushort ID = BitConverter.ToUInt16(packet, 2); System.Console.Write("Packet ID : [{0}] , Lenght : [{1}] \n\n", ID, Length); foreach (byte D in packet) { System.Console.Write((Convert.ToString(D, 16)).PadLeft(2, '0') + " "); } System.Console.Write("\n\n"); }