Home » Object Serialization

Object Serialization

Local Data Storage 5 – Reading and Writing Serialized Objects to a File

Reading and Writing Objects to files or streams is fairly straight forward. Here is a working example. There are a few things to know. Use serialver.exe to create a serial id number for the class. A class must implement Serializable interface and should use @serial tag in Javadoc comments. A cryptic coded file is created which is not very editable or readable. In a later article I will talk about serializing objects to xml streams and files.