Click or drag to resize

ValueWriterT Class

Inheritance Hierarchy
SystemObject
  Ookii.Jumbo.IOValueWriterT

Namespace:  Ookii.Jumbo.IO
Assembly:  Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 2.0.0
Syntax
public static class ValueWriter<T>

Type Parameters

T
The type of the object whose IWritable or IValueWriterT implementation to use.

The ValueWriterT type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberWriter
Gets the writer for the type, or if it implements IWritable.
Top
Methods
Remarks

If you attempt to access this class for a type T that does not implement IWritable and that does not have a implementation of IValueWriterT, an NotSupportedException is thrown by the static type initializer of the ValueWriterT class.

Built-in value writers are provided for the following types: SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, UInt64, Decimal, Single, Double, String, DateTime, Boolean, TupleT1, TupleT1, T2, TupleT1, T2, T3, TupleT1, T2, T3, T4, TupleT1, T2, T3, T4, T5, TupleT1, T2, T3, T4, T5, T6, TupleT1, T2, T3, T4, T5, T6, T7 and TupleT1, T2, T3, T4, T5, T6, T7, TRest.

Although value writers support tuples, there may be negative performance implications from using them. All the .Net Framework tuple types are reference types, but they are read-only and therefore do not support record reuse. This means that for every record, a new tuple object must be created, as well as new instances of any of the tuple's items that are reference types, even in situations where record reuse is allowed.

Instead of using tuples, it is recommended to create a custom class that implements IWritable for your records.

The KeyValuePairTKey, TValue structure is not supported by the value writer. Please use the PairTKey, TValue class instead, which provides additional functionality for key/value pairs required by Jumbo.

See Also