I have a GUI where i try to convert a EBCDIC String into Hex, but i am getting the NumberforamtException.
ebcdichex.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ausgabe6.setText("");
String hexadecimal3 = eingabe4.getText().replace("\n", "");
byte[] chars2;
try {
chars2 = hexadecimal3.getBytes("IBM-273");
StringBuilder hexa2 = new StringBuilder();
for(int i = 0;i<chars2.length;i++){
byte[] b = {(byte) Integer.parseInt(""+chars2.toString(),16)};
hexa2.append(b);
}
ausgabe6.append(hexa2.toString());
}
catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
}
});
Exception:
Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For
input string: "[B@1d05c81"
Does anyone know where my fault is?