File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding serialization

 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an application which make some serialized file at particular location, Now I want to read the value of that serialized file..I am aware of java deserialization process, but I am not aware of the source class which is making this serialized file, Is there any way in java , if suppose i have serialized files with me , i can serialized them and can see the contents of the serialized file..!
 
Joanne Neal
Rancher
Pie
Posts: 3742
16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This describes the format of a serialized file.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could google for something like java serialization viewer. I'm sure people have written tools to do that. It wouldn't be hard to do.

In fact, what you really want is an object graph viewer. It's a two-step process: 1) Deserialize the file back into Java objects. 2) Display those objects. Step #2 is the same regardless of whether the objects came from serialization or just some arbitrary object graph you happen to pick at some point during your program.

Serialization really has nothing to do with it. The code to parse a serialized file is simply ObjectInputStream.readObject().
 
Rob Spoor
Sheriff
Pie
Posts: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne Neal wrote:This describes the format of a serialized file.

http://www.javaworld.com/community/node/2915 is also a good read.
 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

please advise me in detail, as in this case I am not aware of the java classes , which are involved in serializing process so while in the way of deserializing I not aware regarding the type casting..so is there any way that I have the serialized file with me I can see it contents only..!! please advise..!!
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saral Saxena wrote:so is there any way that I have the serialized file with me I can see it contents only..!! please advise..!!


Sure, use a hex editor. I assume that's not what you mean though. You want to see something like:


right? Some human-readable form of the objects that have been serialized?

If so, the only way to do that, obviously, is to deserialize the objects. You don't have to use Java's built-in serialization tools to do that, but why wouldn't you? If you don't, then you just have to write the code yourself to do what they're already doing for you.

So learn how to use ObjectInputStream to read the data (the easy part) and then figure out how to represent an arbitrary object graph in a human-readable fashion (the hard part).
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can open some serialised object files with (surprise) M$ NotePad. You can’t always see the whole object, unfortunately.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic