Ros_CSharp.TcpTransport.ByteDump C# (CSharp) Method

ByteDump() public static method

public static ByteDump ( byte b ) : string
b byte
return string
        public static string ByteDump(byte[] b)
        {
            string s = "";
            string bs = "";
            for (int i = 0; i < b.Length; i++)
            {
                bs = b[i].ToString("x");
                if (b[i] < 16) bs = "" + 0 + bs;
                s += "" + bs + " ";
                if (i%4 == 0) s += "     ";
                if (i%16 == 0 && i != b.Length - 1) s += "\n";
            }
            return s;
        }