This documentation is archived and is not being maintained.

ObjectStateFormatter::Deserialize Method (Stream)

Deserializes an object state graph from its binary-serialized form that is contained in the specified Stream object.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public:
Object^ Deserialize(
	Stream^ inputStream
)

Parameters

inputStream
Type: System.IO::Stream
A Stream that the ObjectStateFormatter deserializes into an initialized object.

Return Value

Type: System::Object
An object that represents a deserialized object state graph.

ExceptionCondition
ArgumentNullException

The specified inputStream is nullptr.

ArgumentException

An exception occurs during deserialization of the Stream. The exception message is appended to the message of the ArgumentException.

Any object state graph that is serialized with the Serialize method can be deserialized with the Deserialize method. The Deserialize(Stream) method is used to restore an object state graph stored in a Stream, such as a FileStream.

The following code example demonstrates how a class that derives from the PageStatePersister class initializes the ViewState collection. In this example, the ViewState collection has been assigned to the First field of a Pair object, and serialized to a file using the ObjectStateFormatter class. When the Load method is called, the Deserialize(Stream) method is used to deserialize view state from the file, and the ViewState property is initialized. This code example is part of a larger example provided for the PageStatePersister class.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: