Una possibile soluzione potrebbe essere questa:
Codice:
// data la String s, stampa il valore esadecimale di ogni carattere di cui e' composta
private void printHex(String s) {
char[] chars = s.toCharArray();
for (char c : chars) {
String hex = Integer.toHexString((int)c);
System.out.println(hex);
}
}