Question on Serialzation
When i serialized an object i stored its state into a text file.When i checked out the contents of that file it contains a myriad of printable as well as non-printable characters.Is there any format of a file as such where i can see how it stores the state of the object,in the sense in textual printable representation or can someone please tell me as to the exactly the way the state is stored in the file
Regards
Quest
> You can use xstream or java.beans.XMLEncoder/Decoder
> instead of the default serialization mechanism. Or
> you could google for a tool to inspect serilized
> objects.
Unforunately i am going the conventional way reading the book on java although i loathe conformity and i am still a bit far from the chapter that covers java.beans.So the first options ruled out till i am through with the api sorrounding.I will check out for the tools to insoect serialized objects on google.Thanks jeff
> No (you cant make serialized objects write out in a
> "readable" way).
> You CAN find the specification online though.
correct me if i am wrong, but i believe you can make serialized objects write out in a readable way.
you have to override their serialization methods, and in those methods write to streams stuff that you can read, but the write and read methods have to work together.
this wont work if you want to serialize existing classes which you cannot modify.
> > although i loathe conformity
> Remind me why you are using java then ?
Because he mistakenly and stubbornly has the idea that software development (in Java in this case) is the right fit for him. I've tried to warn him of the mistake to save him from pain down the road, but there's only so much I can do.