Click or drag to resize

ValueWriterReadNullableT Method

Reads a nullable value from the specified reader using the type's IWritable implementation or its IValueWriterT.

Namespace: Ookii.Jumbo.IO
Assembly: Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 0.3.0+dc1307f20e065bb638e0b73a34cd216f57e486f1
Syntax
public static T ReadNullable<T>(
	BinaryReader reader
)
where T : class

Parameters

reader  BinaryReader
The reader to read the value from.

Type Parameters

T
The type of the object to read.

Return Value

T
An object containing the value.
Remarks

A Boolean is read from reader to see if the value is . If it is , nothing else will be read.

If the type implements IWritable, a new instance is created and Read(BinaryReader) is used to read the value. If it does not, IValueWriterT is used to read the value.

This method will always create a new instance, even if the type implements IWritable, so should not be used in scenarios where you wish to support record reuse.

See Also