BinarySerializerDeserializeByReaderT(BinaryReader, IEnumerableType) Method

Deserializes the content of a serialization stream wrapped by the specified reader from its current position into an instance of T using safe mode.
See the Remarks section of the DeserializeByReaderT(BinaryReader, BinarySerializationOptions, Type) overload for details.

Definition

Namespace: KGySoft.Serialization.Binary
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public static T DeserializeByReader<T>(
	BinaryReader reader,
	IEnumerable<Type>? expectedCustomTypes
)

Parameters

reader  BinaryReader
The reader that wraps the stream containing the serialized data. The reader will remain open after deserialization.
expectedCustomTypes  IEnumerableType
The types that are expected to present in the serialization stream by name. If the stream does not contain any types by name, then this parameter is optional.

Type Parameters

T
The expected type of the result.

Return Value

T
The deserialized instance of T.

See Also