Goedel.Debug.Trace.WriteHex C# (CSharp) Method

WriteHex() public static method

Write out a buffer to the console as hex.
public static WriteHex ( string Text, byte Data ) : void
Text string Tag to identify the data
Data byte Data to be written.
return void
        public static void WriteHex(string Text, byte[] Data) {
            WriteLine(Text);

            string Line = "   ";

            for (int i = 0; i < Data.Length; i++) {
                if (i > 0) {
                    if (i % 16 == 0) {
                        WriteLine(Line);
                        Line = "   ";
                        }
                    else if (i % 8 == 0) {
                        Line = Line + "   ";
                        }
                    }
                Line = Line + string.Format (" {0:x2}", Data[i]);
                }
            WriteLine(Line);
            }