mySobek Home   |   Help
Skip Navigation Links.
Expand <a href='http://sobekrepository.org/sobekcm' title='Sobek home page'>Project Home</a>Project Home
Expand <a href='http://sobekrepository.org/help' title='Online user help'>User Help</a>User Help
Expand <a href='http://sobekrepository.org/sobekcm/technical' title='Sobek home page'>Technical Help</a>Technical Help
Expand <a href='http://sobekrepository.org/software' title='Center for downloading all SobekCM-related software'>Download Center</a>Download Center
Training Videos
Collapse <a href='http://sobekrepository.org/codehelp' title='Details on each of the different classes, interfaces, properties, etc..'>Code Details</a>Code Details
Expand <a href='http://sobekrepository.org/codehelp/engineagnosticlayerdbaccess' title='EngineAgnosticLayerDbAccess'>EngineAgnosticLayerDbAccess Namespace</a>EngineAgnosticLayerDbAccess Namespace
Expand <a href='http://sobekrepository.org/codehelp/builder_library' title='SobekCM.Builder_Library'>Builder_Library Namespace</a>Builder_Library Namespace
Collapse <a href='http://sobekrepository.org/codehelp/core' title='SobekCM.Core'>Core Namespace</a>Core Namespace
Expand <a href='http://sobekrepository.org/codehelp/engine_library' title='SobekCM.Engine_Library'>Engine_Library Namespace</a>Engine_Library Namespace
Expand <a href='http://sobekrepository.org/codehelp/library' title='SobekCM.Library'>Library Namespace</a>Library Namespace
Expand <a href='http://sobekrepository.org/codehelp/resource_object' title='SobekCM.Resource_Object'>Resource_Object Namespace</a>Resource_Object Namespace
Expand <a href='http://sobekrepository.org/codehelp/tools' title='SobekCM.Tools'>Tools Namespace</a>Tools Namespace
MISSING BANNER

SerializationWriter.WriteObject Method



Stores an object into the stream using the fewest number of bytes possible. Stored Size: 1 byte upwards depending on type and/or content. 1 byte: null, DBNull.Value, Boolean 1 to 2 bytes: Int16, UInt16, Byte, SByte, Char, 1 to 4 bytes: Int32, UInt32, Single, BitVector32 1 to 8 bytes: DateTime, TimeSpan, Double, Int64, UInt64 1 or 16 bytes: Guid 1 plus content: string, object[], byte[], char[], BitArray, Type, ArrayList Any other object be stored using a .Net Binary formatter but this should only be allowed as a last resort: Since this is effectively a different serialization session, there is a possibility of the same shared object being serialized twice or, if the object has a reference directly or indirectly back to the parent object, there is a risk of looping which will throw an exception. The type of object is checked with the most common types being checked first. Each 'section' can be reordered to provide optimum speed but the check for null should always be first and the default serialization always last. Once the type is identified, a SerializedType byte is stored in the stream followed by the data for the object (certain types/values may not require storage of data as the SerializedType may imply the value). For certain objects, if the value is within a certain range then optimized storage may be used. If the value doesn't meet the required optimization criteria then the value is stored directly. The checks for optimization may be disabled by setting the OptimizeForSize property to false in which case the value is stored directly. This could result in a slightly larger stream but there will be a speed increate to compensate.


Namespace: SobekCM.Core.MemoryMgmt
Assembly: SobekCM_Core (in SobekCM_Core.dll) Version: 4.10.0.0 (4.10.0.0)

Syntax

C#
public void WriteObject(
	Object value
)

Parameters

value
Type: System..::..Object
The object to store.

See Also



Version 4.10.0 ( last generated Monday, March 7, 2016 )