public byte[] stringToEbcdic(String s, String encoding){
String payload = null;
try {
payload = new String(s.getBytes("encoding"), "ISO-8859-1");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return payload.getBytes();
}
I should be able to call the method like
byte[] b = stringToEbcdic("abcd", "IBM01140");
but its not working.