IFormatter 인터페이스

정의

주의

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

직렬화된 개체의 서식을 지정하는 기능을 제공합니다.

public interface class IFormatter
[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 interface IFormatter
public interface IFormatter
[System.Runtime.InteropServices.ComVisible(true)]
public interface IFormatter
[<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}")>]
type IFormatter = interface
type IFormatter = interface
[<System.Runtime.InteropServices.ComVisible(true)>]
type IFormatter = interface
Public Interface IFormatter
파생
특성

설명

이 인터페이스는 아키텍처에서 포맷터로 식별되는 모든 클래스에 System.Runtime.Serialization 의해 구현되어야 합니다.

자체 직렬화를 제어하는 개체는 인터페이스를 구현하여 ISerializable 이 작업을 수행할 수 있습니다. 개체를 serialize하려면 해당 개체를 serialize할 수 있는 것으로 표시해야 합니다. 이 작업은 serialize 가능한 특성을 클래스에 적용하여 수행할 수 있습니다. 그래프의 개체를 직렬화할 수 없는 경우 serialization에 실패합니다.

구현자 참고

모든 포맷터는 이 인터페이스를 구현해야 합니다. Serialize(Stream, Object) 개체나 개체 그래프를 직렬화하는 데 사용합니다. 스트림을 역직렬화하고 원래 개체 또는 개체 그래프의 복제본을 만드는 데 사용합니다 Deserialize(Stream) .

속성

Name Description
Binder
사용되지 않음.

역직렬화 중에 형식 조회를 수행하는 값을 가져오거나 설정합니다 SerializationBinder .

Context
사용되지 않음.

serialization 및 deserialization에 사용되는 값을 가져오거나 설정합니다 StreamingContext .

SurrogateSelector
사용되지 않음.

현재 포맷터에서 SurrogateSelector 사용되는 값을 가져오거나 설정합니다.

메서드

Name Description
Deserialize(Stream)
사용되지 않음.

제공된 스트림의 데이터를 역직렬화하고 개체 그래프를 다시 구성합니다.

Serialize(Stream, Object)
사용되지 않음.

제공된 스트림에 지정된 루트를 사용하여 개체 또는 개체 그래프를 직렬화합니다.

적용 대상

추가 정보