I\'m serializing my objects with ObjectOutputStream(FileOutputStream(File))
and deserializing them with the analogous InputStreams
. Is there a way to l
Write some tests (using Eclipse's built-in JUnit support).
The only way to "look inside" these files is to use ObjectInputStream(FileInputStream(File))
, unless you're a bytecode guru and use a hex editor. If you actually have some testing, there is no need to "look inside" anything.
Write a class which loads the file and deserialises the object. Then use Eclipse's Debugging View to browse the object (by setting a breakpoint).
This is not a "free standing" answer, just an expansion of OrangeDog's answer.
"Write some tests (using Eclipse's built-in JUnit support). "
If you want to test serialization, then write tests that do the following:
While this isn't a full fledged editor, Eamonn McManus has written a transcoder which deciphers a serialized blob into a human readable form. http://weblogs.java.net/blog/2007/06/12/disassembling-serialized-java-objects
If binary compatibility and performance are considerations, this would be a good time to look into Externalizable instead of Serializable.