IFormatter 인터페이스

정의

주의

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

serialize된 개체의 형식을 지정하기 위한 기능을 제공합니다.

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

설명

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

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

구현자 참고

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

속성

Binder
사용되지 않음.

deserialization 중에 형식 조회를 수행하는 SerializationBinder를 가져오거나 설정합니다.

Context
사용되지 않음.

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

SurrogateSelector
사용되지 않음.

현재 포맷터가 사용하는 SurrogateSelector를 가져오거나 설정합니다.

메서드

Deserialize(Stream)
사용되지 않음.

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

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

개체 또는 루트가 지정된 개체 그래프를 제공된 스트림에 Serialize합니다.

적용 대상

추가 정보