Properties contain built-in support that make it easy to write and read their values to and from persistent storage.
First, PropertyInfo contains the methods
which allow an individual object value to written to a PrintStream or scanned from a ReaderTokenizer.
Second, if the host object maintains a PropertyList, it can use the convenience method
to write out values for all properties for which getAutoWrite() returns true. Properties will be written in the form
where value is the output from the writeValue method of the PropertyInfo structure.
To economize on file space, there is another method which only writes out property values when those values differ from the property’s default value:
Again, values are written only for the properties for which getAutoWrite() returns true. The method returns false if not property values are written.
To read in property values, their are the methods
where the former will inspect the input stream and scan in any recognized property of the form propertyName = value (returning true if such a property was found), while the latter will check the input for a property with a specific name (and return true if the specified property was found).