Does Eclipse have an editor/viewer for java serialized files?

后端 未结 4 1252
借酒劲吻你
借酒劲吻你 2021-02-13 13:06

I\'m serializing my objects with ObjectOutputStream(FileOutputStream(File)) and deserializing them with the analogous InputStreams. Is there a way to l

4条回答
  •  佛祖请我去吃肉
    2021-02-13 13:58

    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:

    1. Serialize one object to a file.
    2. Deserialize to a different object from the same file.
    3. Compair both objects to see that the deserialized object contains all of the values that were supposed to have been serialized (i.e. make sure that "all necessary attributes were written").

提交回复
热议问题