I have a byte array that I want to convert its value in hexadecimal.
byte array = [48, 48, 28, ...]
--->
hex byte array = [30, 30, 1C, ...]
I have a byte array that I want to convert its value in hexadecimal.
byte array = [48, 48, 28, ...]
--->
hex byte array = [30, 30, 1C, ...]
This should work. Maybe you have to convert byte
to int
if its not casted implicitly.
String[] hexArray = new String[byteArray.length];
for(int index = 0; index < byteArray.length; index++) {
hexArray[index] = Integer.toHexString(byteArray[index]);
// maybe you have to convert your byte to int before this can be done
// (cannot check reight now)
}
check Integer.toHexString method. iT will convert an int to a hex string. so iterate through your array and convert each number.