This discussion is archived
3 Replies Latest reply: May 5, 2010 4:39 PM by EJP RSS

serializing to hex string

843790 Newbie
Currently Being Moderated
Hi,

I am trying to serialize an object, when i look at the file to which it is written....it looks as below
¬í sr State€îƒŒ¨e     ½

Wheras I would like to get output in hex.....something like this..
\\xAC\\xED\\x00\\x05sr\\x00

If you can help me then it would be great...

Regards,
PAWAN
  • 1. Re: serializing to hex string
    EJP Guru
    Currently Being Moderated
    Well hex isn't a format, it is a representation, and it doesn't look like your sample, but if you want to define the output format you are going to have to write the code that produces it.

    Why do you think you want it like that? Java serialization does work and it solves a lot of ancillary problems you're probably not even aware of.
  • 2. Re: serializing to hex string
    843790 Newbie
    Currently Being Moderated
    I am trying to parameterize the serialized objects to LoadRunner....and LR accepts serialized object in the format/representation given above...

    And yeah it is hex....if you see any serialized object in an editor which supports hex then it will look like this...atleast the beginning..

    Regards,
    PAWAN
  • 3. Re: serializing to hex string
    EJP Guru
    Currently Being Moderated
    No, it isn't hex. It is binary. Hex is how you print it.

    LoadRunner is not part of the JDK and I have no idea what its serialization format is. You should ask the vendor.