wood burning stoves 2.0*
The moose likes Java in General and the fly likes Java message to Mainframe MQ byte conversion issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java message to Mainframe MQ byte conversion issue" Watch "Java message to Mainframe MQ byte conversion issue" New topic
Author

Java message to Mainframe MQ byte conversion issue

Frederik Ericsson
Ranch Hand

Joined: Apr 27, 2005
Posts: 128
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

Joined: Jun 06, 2007
Posts: 2716
    
    6

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.


SCJP, SCWCD.
|Asking Good Questions|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java message to Mainframe MQ byte conversion issue