Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java message to Mainframe MQ byte conversion issue  RSS feed

 
Frederik Ericsson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Team,

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.

 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!