Click or drag to resize

IValueWriterT Interface

Interface for binary serialization of types that don't support IWritable.

Namespace: Ookii.Jumbo.IO
Assembly: Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 0.3.0+dc1307f20e065bb638e0b73a34cd216f57e486f1
Syntax
public interface IValueWriter<T>

Type Parameters

T
The type of the records.

The IValueWriterT type exposes the following members.

Methods
 NameDescription
Public methodRead Reads a value from the specified reader.
Public methodWrite Writes the specified value to the specified writer.
Top
Remarks

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.

See Also