Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Properties | List of all members
SyncBinary.Options.ForReader Class Reference

Source file:

Properties

bool SilentlyTruncateLargeNumbers [get, set]
 If this is true, numbers in the data stream that are too large to fit in the requested type are silently truncated. If this is false, such large numbers cause Reader to throw OverflowException. More...
 
bool ReadNullPrimitivesAsDefault = false [get, set]
 This property requests that if a property is set to null but read as a primitive type, the default value of that type should be returned instead of throwing FormatException. For example, if you call Reader.Sync(FieldId, int) but it encounters a null, it will return 0 instead if throwing an exception if this property is true. More...
 
bool VerifyEof = false [get, set]
 When this property is true and the root object has been read successfully, the reader checks whether there is additional data beyond the end of what was read, and throws an exception if the data stream hasn't ended. More...
 

Property Documentation

bool SyncBinary.Options.ForReader.ReadNullPrimitivesAsDefault = false
getset

This property requests that if a property is set to null but read as a primitive type, the default value of that type should be returned instead of throwing FormatException. For example, if you call Reader.Sync(FieldId, int) but it encounters a null, it will return 0 instead if throwing an exception if this property is true.

See also
ObjectMode.ReadNullAsDefault
bool SyncBinary.Options.ForReader.SilentlyTruncateLargeNumbers
getset

If this is true, numbers in the data stream that are too large to fit in the requested type are silently truncated. If this is false, such large numbers cause Reader to throw OverflowException.

For example, 33000 is too large for Int16, and if this property is true it will be "truncated" to -32536.

Setting this flag may increase performance slightly.

bool SyncBinary.Options.ForReader.VerifyEof = false
getset

When this property is true and the root object has been read successfully, the reader checks whether there is additional data beyond the end of what was read, and throws an exception if the data stream hasn't ended.