ValueWriterT Class |
Namespace: Ookii.Jumbo.IO
The ValueWriterT type exposes the following members.
Name | Description | |
---|---|---|
ReadValue |
Reads a value from the specified reader using the type's IWritable implementation or its IValueWriterT.
| |
WriteValue |
Writes the specified value using its IWritable implementation or its IValueWriterT.
|
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.