IValueWriterT Interface |
Namespace: Ookii.Jumbo.IO
The IValueWriterT type exposes the following members.
Name | Description | |
---|---|---|
Read |
Reads a value from the specified reader.
| |
Write |
Writes the specified value to the specified writer.
|
Jumbo provides its own simple, light-weight serialization protocol that is primarily used by the BinaryRecordReaderT and BinaryRecordWriterT classes (although it is also used in a few other places).
Normally, classes support this protocol by implementing the IWritable interface. However, the IWritable interface cannot be used on value types (structs) because of the semantics of calling interface methods that modify the object's state on a value type.
To provide serialization support for a value type, you must create a class implementing IValueWriterT for that value type, and mark the value type with the ValueWriterAttribute. Although you can use IValueWriterT for reference types as well, this is not recommended because IValueWriterT doesn't support record reuse.
Jumbo also provides IValueWriterT implementations for several built-in framework types.
To access the IValueWriterT implementation for a type, use the ValueWriterT class.