• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

regarding serialization

 
Ranch Hand
Posts: 203
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..!
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This describes the format of a serialized file.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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().
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic