mySobek Home   |   Help
Skip Navigation Links.
Expand <a href='https://sobekrepository.org/sobekcm' title='Sobek home page'>Project Home</a>Project Home
Expand <a href='https://sobekrepository.org/help' title='Online user help'>User Help</a>User Help
Expand <a href='https://sobekrepository.org/sobekcm/technical' title='Sobek home page'>Technical Help</a>Technical Help
Expand <a href='https://sobekrepository.org/software' title='Center for downloading all SobekCM-related software'>Download Center</a>Download Center
Training Videos
Collapse <a href='https://sobekrepository.org/codehelp' title='Details on each of the different classes, interfaces, properties, etc..'>Code Details</a>Code Details
MISSING BANNER
Code Details >> Core >> MemoryMgmt >> SerializationReader

SerializationReader Class



A SerializationReader instance is used to read stored values and objects from a byte array. Once an instance is created, use the various methods to read the required data. The data read MUST be exactly the same type and in the same order as it was written.


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

Syntax

C#
public sealed class SerializationReader : BinaryReader

Inheritance Hierarchy

System..::..Object
  System.IO..::..BinaryReader
    SobekCM.Core.MemoryMgmt..::..SerializationReader

Constructors

  NameDescription
Public methodSerializationReader
Creates a SerializationReader using a byte[] previous created by SerializationWriter A MemoryStream is used to access the data without making a copy of it.

Methods

  NameDescription
Public methodDumpStringTables
Dump string table during debugging
Public methodReadArrayList
Returns an ArrayList or null from the stream.
Public methodReadBitArray
Returns a BitArray or null from the stream.
Public methodReadBitVector32
Returns a BitVector32 value from the stream.
Public methodReadBooleanArray
Returns a Boolean[] from the stream.
Public methodReadByteArray
Returns a Byte[] from the stream.
Public methodReadBytesDirect
Reads the specified number of bytes directly from the stream.
Public methodReadCharArray
Returns a Char[] from the stream.
Public methodReadDateTime
Returns a DateTime value from the stream.
Public methodReadDateTimeArray
Returns a DateTime[] from the stream.
Public methodReadDecimalArray
Returns a Decimal[] from the stream.
Public methodReadDictionary<(Of <<'(K, V>)>>)()()()()
Returns a new, simple generic dictionary populated with keys and values from the stream.
Public methodReadDictionary<(Of <<'(K, V>)>>)(Dictionary<(Of <<'(K, V>)>>))
Populates a pre-existing generic dictionary with keys and values from the stream. This allows a generic dictionary to be created without using the default constructor.
Public methodReadDoubleArray
Returns a Double[] from the stream.
Public methodReadGuid
Returns a Guid value from the stream.
Public methodReadGuidArray
Returns a Guid[] from the stream.
Public methodReadInt16Array
Returns an Int16[] from the stream.
Public methodReadInt32Array
Returns an Int32[] from the stream.
Public methodReadInt64Array
Returns an Int64[] from the stream.
Public methodReadList<(Of <<'(T>)>>)
Returns a generic List populated with values from the stream.
Public methodReadNullable
Returns a Nullable struct from the stream. The value returned must be cast to the correct Nullable type. Synonym for ReadObject();
Public methodReadNullableBoolean
Returns a Nullable Boolean from the stream.
Public methodReadNullableByte
Returns a Nullable Byte from the stream.
Public methodReadNullableChar
Returns a Nullable Char from the stream.
Public methodReadNullableDateTime
Returns a Nullable DateTime from the stream.
Public methodReadNullableDecimal
Returns a Nullable Decimal from the stream.
Public methodReadNullableDouble
Returns a Nullable Double from the stream.
Public methodReadNullableGuid
Returns a Nullable Guid from the stream.
Public methodReadNullableInt16
Returns a Nullable Int16 from the stream.
Public methodReadNullableInt32
Returns a Nullable Int32 from the stream.
Public methodReadNullableInt64
Returns a Nullable Int64 from the stream.
Public methodReadNullableSByte
Returns a Nullable SByte from the stream.
Public methodReadNullableSingle
Returns a Nullable Single from the stream.
Public methodReadNullableTimeSpan
Returns a Nullable TimeSpan from the stream.
Public methodReadNullableUInt16
Returns a Nullable UInt16 from the stream.
Public methodReadNullableUInt32
Returns a Nullable UInt32 from the stream.
Public methodReadNullableUInt64
Returns a Nullable UInt64 from the stream.
Public methodReadObject
Returns an object based on the SerializedType read next from the stream.
Public methodReadObjectArray()()()()
Returns an object[] or null from the stream.
Public methodReadObjectArray(Type)
Returns an object[] or null from the stream. The returned array will be typed according to the specified element type and the resulting array can be cast to the expected type. e.g. string[] myStrings = (string[]) reader.ReadObjectArray(typeof(string)); An exception will be thrown if any of the deserialized values cannot be cast to the specified elementType.
Public methodReadOptimizedArrayList
Returns an ArrayList from the stream that was stored optimized.
Public methodReadOptimizedBitArray
Returns a BitArray from the stream that was stored optimized.
Public methodReadOptimizedBitVector32
Returns a BitVector32 value from the stream that was stored optimized.
Public methodReadOptimizedBooleanArray
Returns a Boolean[] from the stream.
Public methodReadOptimizedDateTime
Returns a DateTime value from the stream that was stored optimized.
Public methodReadOptimizedDateTimeArray
Returns a DateTime[] from the stream.
Public methodReadOptimizedDecimal
Returns a Decimal value from the stream that was stored optimized.
Public methodReadOptimizedDecimalArray
Returns a Decimal[] from the stream.
Public methodReadOptimizedInt32
Returns an Int32 value from the stream that was stored optimized.
Public methodReadOptimizedInt32Array
Returns a Int32[] from the stream.
Public methodReadOptimizedInt64
Returns an Int64 value from the stream that was stored optimized.
Public methodReadOptimizedInt64Array
Returns a Int64[] from the stream.
Public methodReadOptimizedObjectArray()()()()
Returns an object[] from the stream that was stored optimized.
Public methodReadOptimizedObjectArray(Type)
Returns an object[] from the stream that was stored optimized. The returned array will be typed according to the specified element type and the resulting array can be cast to the expected type. e.g. string[] myStrings = (string[]) reader.ReadOptimizedObjectArray(typeof(string)); An exception will be thrown if any of the deserialized values cannot be cast to the specified elementType.
Public methodReadOptimizedObjectArrayPair
Returns a pair of object[] arrays from the stream that were stored optimized.
Public methodReadOptimizedString
Returns a string value from the stream that was stored optimized.
Public methodReadOptimizedStringArray
Returns a string[] from the stream that was stored optimized.
Public methodReadOptimizedTimeSpan
Returns a TimeSpan value from the stream that was stored optimized.
Public methodReadOptimizedTimeSpanArray
Returns a TimeSpan[] from the stream.
Public methodReadOptimizedType()()()()
Returns a Type from the stream. Throws an exception if the Type cannot be found.
Public methodReadOptimizedType(Boolean)
Returns a Type from the stream. Throws an exception if the Type cannot be found and throwOnError is true.
Public methodReadOptimizedUInt32
Returns a UInt32 value from the stream that was stored optimized.
Public methodReadOptimizedUInt32Array
Returns a UInt32[] from the stream.
Public methodReadOptimizedUInt64
Returns a UInt64 value from the stream that was stored optimized.
Public methodReadOptimizedUInt64Array
Returns a UInt64[] from the stream.
Public methodReadOwnedData
Allows an existing object, implementing IOwnedDataSerializable, to retrieve its owned data from the stream.
Public methodReadSByteArray
Returns an SByte[] from the stream.
Public methodReadSingleArray
Returns a Single[] from the stream.
Public methodReadString
Called ReadOptimizedString(). This override to hide base BinaryReader.ReadString().
(Overrides BinaryReader..::..ReadString()()()().)
Public methodReadStringArray
Returns a string[] or null from the stream.
Public methodReadStringDirect
Returns a string value from the stream.
Public methodReadTimeSpan
Returns a TimeSpan value from the stream.
Public methodReadTimeSpanArray
Returns a TimeSpan[] from the stream.
Public methodReadTokenizedObject
Returns the object associated with the object token read next from the stream.
Public methodReadType()()()()
Returns a Type or null from the stream. Throws an exception if the Type cannot be found.
Public methodReadType(Boolean)
Returns a Type or null from the stream. Throws an exception if the Type cannot be found and throwOnError is true.
Public methodReadTypedArray
Returns a typed array from the stream.
Public methodReadUInt16Array
Returns a UInt16[] from the stream.
Public methodReadUInt32Array
Returns a UInt[] from the stream.
Public methodReadUInt64Array
Returns a UInt64[] from the stream.

Properties

  NameDescription
Public propertyBytesRemaining
Returns the number of bytes or serialized remaining to be processed. Useful for checking that deserialization is complete. Warning: Retrieving the Position in certain stream types can be expensive, e.g. a FileStream, so use sparingly unless known to be a MemoryStream.

See Also



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