IFormatter.Serialize(Stream, Object) Methode

Definitie

Let op

BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.

Hiermee serialiseert u een object of grafiek met objecten met de opgegeven hoofdmap naar de opgegeven stroom.

public:
 void Serialize(System::IO::Stream ^ serializationStream, System::Object ^ graph);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
public void Serialize(System.IO.Stream serializationStream, object graph);
[System.Obsolete("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId="SYSLIB0011", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void Serialize(System.IO.Stream serializationStream, object graph);
[System.Obsolete("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId="SYSLIB0011", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")]
public void Serialize(System.IO.Stream serializationStream, object graph);
public void Serialize(System.IO.Stream serializationStream, object graph);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")>]
abstract member Serialize : System.IO.Stream * obj -> unit
[<System.Obsolete("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId="SYSLIB0011", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Serialize : System.IO.Stream * obj -> unit
[<System.Obsolete("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId="SYSLIB0011", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("BinaryFormatter serialization is not trim compatible because the Type of objects being processed cannot be statically discovered.")>]
abstract member Serialize : System.IO.Stream * obj -> unit
abstract member Serialize : System.IO.Stream * obj -> unit
Public Sub Serialize (serializationStream As Stream, graph As Object)

Parameters

serializationStream
Stream

De stream waarin de formatter de geserialiseerde gegevens plaatst. Deze stroom kan verwijzen naar verschillende back-uparchieven (zoals bestanden, netwerk, geheugen, enzovoort).

graph
Object

Het object, of de hoofdmap van de objectgrafiek, om te serialiseren. Alle onderliggende objecten van dit hoofdobject worden automatisch geserialiseerd.

Kenmerken

Opmerkingen

De Serialize methode serialiseert automatisch de opgegeven objecten en alle objecten die eraan zijn verbonden, met de opgegeven stroom.

Standaard registreert het serialisatieproces de status van een object door de waarden van alle velden (openbaar en privé) te verzamelen. Deze velden worden opgeslagen in de stroom, samen met informatie over het object, zoals de naam die is gekwalificeerd door de assembly voor het type.

Van toepassing op

Zie ook