seeking guidance
------ Solution ---------------------------------- ----------
it is a marker interface .
------ Solution ---------------------------------------- ----
serialization is a historical problem , it can be said that design flaws in Java world.
" Why implement Serializable serialization can be achieved ."
simple answer is the key ObjectInputStream and ObjectOutputStream method will serialize the Object you want to do the inspection, the type must be Serializable.
correct sequence of design work to be done is definitely more than just add implements Serializable so simple.
------ Solution ---------------------------------------- ----
serialization implementation: will need to be serialized class implements serializable interface, which does not need to implement the method , implements Serializable just to mark the object is being serialized , and then use an output streams ( such as : FileOutputStream) to construct a ObjectOutputStream ( object stream ) object , then use ObjectOutputStream object writeObject (Object obj) method can be an object obj parameter write ( ie save its state ) , to restore if the input stream .
------ For reference only -------------------------------------- -
seeking Detailed
------ For reference only ------------------------------ ---------
Detailed requirements
没有评论:
发表评论