SerializationWriter Properties |
The SerializationWriter type exposes the following members.
Name | Description | |
---|---|---|
AllowStoreTokenTablePresizeInfo |
Gets a boolean flag which indicates whether AppendTokenTables
will store the presize information for the string and object
token tables.
| |
BaseStream | (Inherited from BinaryWriter.) | |
ObjectTokenTableSize |
Returns the number of objects in the object token table.
| |
OptimizeForSize |
Gets or Sets a boolean flag to indicate whether to optimize for size (default)
by storing data as packed bits or sections where possible.
Setting this value to false will turn off this optimization and store
data directly which increases the speed.
Note: This only affects optimization of data passed to the WriteObject method
and direct calls to the WriteOptimized methods will always pack data into
the smallest space where possible.
| |
PreserveDecimalScale |
Gets or Sets a boolean flag to indicate whether to preserve the scale within
a Decimal value when it would have no effect on the represented value.
Note: a 2m value and a 2.00m value represent the same value but internally they
are stored differently - the former has a value of 2 and a scale of 0 and
the latter has a value of 200 and a scale of 2.
The scaling factor also preserves any trailing zeroes in a Decimal number.
Trailing zeroes do not affect the value of a Decimal number in arithmetic or
comparison operations. However, trailing zeroes can be revealed by the ToString
method if an appropriate format string is applied.
From a serialization point of view, the former will take 2 bytes whereas the
latter would take 4 bytes, therefore it is preferable to not save the scale where
it doesn't affect the represented value.
| |
StringTokenTableSize |
Returns the number of strings in the string token table.
| |
TypeSurrogates |
gets the list of optional IFastSerializationTypeSurrogate instances which
SerializationWriter and SerializationReader will use to serialize objects not directly supported.
It is important to use the same list on both client and server ends to ensure that the same surrogated-types are supported.
| |
TypeUsage |
Gets the type usage.
|