hex - How to convert byte to hexadecimal string in Java -


this question has answer here:

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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -