Click or drag to resize

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.
Inheritance Hierarchy
SystemObject
  System.IOBinaryReader
    SD.LLBLGen.Pro.ORMSupportClassesSerializationReader

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.10.0.0 (5.10.0)
Syntax
public sealed class SerializationReader : BinaryReader

The SerializationReader type exposes the following members.

Constructors
  NameDescription
Public methodSerializationReader(Byte)
Creates a SerializationReader using a byte[] previous created by SerializationWriter A MemoryStream is used to access the data without making a copy of it.
Public methodSerializationReader(Stream)
Creates a SerializationReader based on the passed Stream.
Public methodSerializationReader(Stream, Boolean)
Initializes a new instance of the SerializationReader class.
Public methodSerializationReader(Stream, Int32, Int32)
Creates a SerializationReader based around the passed Stream. Allows the string and object token tables to be presized using the specified values.
Top
Properties
  NameDescription
Public propertyBaseStream
Exposes access to the underlying stream of the BinaryReader.
(Inherited from BinaryReader.)
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.
Top
Methods
  NameDescription
Public methodClose
Closes the current reader and the underlying stream.
(Inherited from BinaryReader.)
Public methodDispose
Releases all resources used by the current instance of the BinaryReader class.
(Inherited from BinaryReader.)
Public methodDumpStringTables
Dumps the string tables.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodPeekChar
Returns the next available character and does not advance the byte or character position.
(Inherited from BinaryReader.)
Public methodRead
Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.
(Inherited from BinaryReader.)
Public methodRead(Char, Int32, Int32)
Reads the specified number of characters from the stream, starting from a specified point in the character array.
(Inherited from BinaryReader.)
Public methodRead(Byte, Int32, Int32)
Reads the specified number of bytes from the stream, starting from a specified point in the byte array.
(Inherited from BinaryReader.)
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 methodReadBoolean
Reads a Boolean value from the current stream and advances the current position of the stream by one byte.
(Inherited from BinaryReader.)
Public methodReadBooleanArray
Returns a Boolean[] from the stream.
Public methodReadByte
Reads the next byte from the current stream and advances the current position of the stream by one byte.
(Inherited from BinaryReader.)
Public methodReadByteArray
Returns a Byte[] from the stream.
Public methodReadBytes
Reads the specified number of bytes from the current stream into a byte array and advances the current position by that number of bytes.
(Inherited from BinaryReader.)
Public methodReadBytesDirect
Reads the specified number of bytes directly from the stream.
Public methodReadChar
Reads the next character from the current stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.
(Inherited from BinaryReader.)
Public methodReadCharArray
Returns a Char[] from the stream.
Public methodReadChars
Reads the specified number of characters from the current stream, returns the data in a character array, and advances the current position in accordance with the Encoding used and the specific character being read from the stream.
(Inherited from BinaryReader.)
Public methodReadDateTime
Returns a DateTime value from the stream.
Public methodReadDateTimeArray
Returns a DateTime[] from the stream.
Public methodReadDecimal
Reads a decimal value from the current stream and advances the current position of the stream by sixteen bytes.
(Inherited from BinaryReader.)
Public methodReadDecimalArray
Returns a Decimal[] from the stream.
Public methodReadDictionaryK, V
Returns a new, simple generic dictionary populated with keys and values from the stream.
Public methodReadDictionaryK, V(DictionaryK, 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 methodReadDouble
Reads an 8-byte floating point value from the current stream and advances the current position of the stream by eight bytes.
(Inherited from BinaryReader.)
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 methodReadInt16
Reads a 2-byte signed integer from the current stream and advances the current position of the stream by two bytes.
(Inherited from BinaryReader.)
Public methodReadInt16Array
Returns an Int16[] from the stream.
Public methodReadInt32
Reads a 4-byte signed integer from the current stream and advances the current position of the stream by four bytes.
(Inherited from BinaryReader.)
Public methodReadInt32Array
Returns an Int32[] from the stream.
Public methodReadInt64
Reads an 8-byte signed integer from the current stream and advances the current position of the stream by eight bytes.
(Inherited from BinaryReader.)
Public methodReadInt64Array
Returns an Int64[] from the stream.
Public methodReadListT
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 methodReadOptimizedInt16
Returns an Int16 value from the stream that was stored optimized.
Public methodReadOptimizedInt16Array
Returns a Int16[] 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 methodReadOptimizedUInt16
Returns a UInt16 value from the stream that was stored optimized.
Public methodReadOptimizedUInt16Array
Returns a UInt16[] from the stream.
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 methodReadSByte
Reads a signed byte from this stream and advances the current position of the stream by one byte.
(Inherited from BinaryReader.)
Public methodReadSByteArray
Returns an SByte[] from the stream.
Public methodReadSingle
Reads a 4-byte floating point value from the current stream and advances the current position of the stream by four bytes.
(Inherited from BinaryReader.)
Public methodReadSingleArray
Returns a Single[] from the stream.
Public methodReadString
Called ReadOptimizedString(). This override to hide base BinaryReader.ReadString().
(Overrides BinaryReaderReadString.)
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 methodReadUInt16
Reads a 2-byte unsigned integer from the current stream using little-endian encoding and advances the position of the stream by two bytes.
(Inherited from BinaryReader.)
Public methodReadUInt16Array
Returns a UInt16[] from the stream.
Public methodReadUInt32
Reads a 4-byte unsigned integer from the current stream and advances the position of the stream by four bytes.
(Inherited from BinaryReader.)
Public methodReadUInt32Array
Returns a UInt[] from the stream.
Public methodReadUInt64
Reads an 8-byte unsigned integer from the current stream and advances the position of the stream by eight bytes.
(Inherited from BinaryReader.)
Public methodReadUInt64Array
Returns a UInt64[] from the stream.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also