This documentation is archived and is not being maintained.

BinaryFormatter.Deserialize Method (Stream, HeaderHandler)

.NET Framework 1.1

Deserializes the specified stream into an object graph. The provided HeaderHandler handles any headers in that stream.

[Visual Basic]
Overloads Public Overridable Function Deserialize( _
   ByVal serializationStream As Stream, _
   ByVal handler As HeaderHandler _
) As Object Implements IRemotingFormatter.Deserialize
public virtual object Deserialize(
 Stream serializationStream,
 HeaderHandler handler
public: virtual Object* Deserialize(
 Stream* serializationStream,
 HeaderHandler* handler
public function Deserialize(
   serializationStream : Stream,
 handler : HeaderHandler
) : Object;


The stream from which to deserialize the object graph.
The HeaderHandler that handles any headers in the serializationStream. Can be a null reference (Nothing in Visual Basic).

Return Value

The deserialized object or the top object (root) of the object graph.




Exception Type Condition
ArgumentNullException The serializationStream is a null reference (Nothing in Visual Basic).
SerializationException The serializationStream supports seeking, but its length is 0.
SecurityException The caller does not have the required permission.


Headers are used only for specific remoting applications.

Note   In order for deserialization to succeed the current position in the stream must be at the beginning of the object graph.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

BinaryFormatter Class | BinaryFormatter Members | System.Runtime.Serialization.Formatters.Binary Namespace | BinaryFormatter.Deserialize Overload List