Java message to Mainframe MQ byte conversion issue
posted 2 years ago
I'm passing this msg "1234567HHHD" to mainframe MQ, that service accepts only 11 bytes as a input, the mainframe guy debug and said that he is getting 83 bytes, so it fails.
"1234567HHHD". getBytes() // this is the code which I used to convert.
when I print it shows the length 11, but something I missed, am not sure what and how to get it. Please let me know if you need more information.
Frederik Ericsson wrote:when I print it shows the length 11
How are you printing the length of the obtained bytes??
11 is the length of the string you are converting to bytes. In normal case, it is not possible to get 11 bytes from a 11 character string in Java.