.NET Framework Class Library
DataContractJsonSerializer..::.ReadObject Method (Stream)

Reads a document stream in the JSON (JavaScript Object Notation) format and returns the deserialized object.

Namespace:  System.Runtime.Serialization.Json
Assembly:  System.ServiceModel.Web (in System.ServiceModel.Web.dll)
Syntax

Visual Basic (Declaration)
Public Overrides Function ReadObject ( _
    stream As Stream _
) As Object
Visual Basic (Usage)
Dim instance As DataContractJsonSerializer
Dim stream As Stream
Dim returnValue As Object

returnValue = instance.ReadObject(stream)
C#
public override Object ReadObject(
    Stream stream
)
Visual C++
public:
virtual Object^ ReadObject(
    Stream^ stream
) override
JScript
public override function ReadObject(
    stream : Stream
) : Object

Parameters

stream
Type: System.IO..::.Stream
The Stream to be read.

Return Value

Type: System..::.Object
The deserialized object.
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5
See Also

Reference

Tags :


Community Content

KarstenJ
Simple Code Sample
//an example of taking json as string and deserializing it
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(MyObject));
Stream s = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(json_string));
MyObject obj = ser.ReadObject(s) as MyObject;
Tags :

Page view tracker