June 2006
Intermediate to advanced
1344 pages
42h 52m
English
We begin by creating and writing serialized objects to a sequential-access file. In this section, we reuse much of the code from Section 18.5, so we focus only on the new features.
Let us begin by modifying our Record class (Fig. 18.8) so that objects of this class can be serialized. Class RecordSerializable (Fig. 18.13) is marked with the <Serializable()> attribute (line 5), which indicates to the CLR that objects of class RecordSerializable can be serialized. The classes for objects that we wish to write to or read from a stream must include this attribute in their declarations or must implement interface ISerializable (from namespace ...
Read now
Unlock full access