I have an integer and I want to convert it to hex value. I am building a message header with each byte value of this array below indicating a specific information about the message.
I want to represent the length of the message in 2 bytes len1 and len2 below.
How do I do this?
byte[] headerMsg =new byte [] { 0x0A, 0x01, 0x00, 0x16,
0x11, 0x0d, 0x0e len1 len2};
int lenMsg //in 2 bytes
Thanks