Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java message to Mainframe MQ byte conversion issue

 
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: 2854
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic