hex - How to convert byte to hexadecimal string in Java -
this question has answer here:
- java code convert byte hexadecimal 16 answers
i have mac address represented byte[] in java , want hexadecimal string, represented. how can easy possible?
the byte array has length 6.
try this:
string hexvalue = string.format("%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
Comments
Post a Comment