Convert Byte array to hexadecimal string in Java
Description
The following code shows how to convert Byte array to hexadecimal string.
Example
// w w w . j a v a 2 s .co m
public class Main {
public static void main(String[] args) throws Exception {
int i = Integer.valueOf("1234A", 16).intValue();
// or
i = Integer.parseInt("BBA", 16);
}
}
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »