Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
ReadObject Method
 ReadObject Method (Stream)

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.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)
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.

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.

.NET Framework

Supported in: 3.5
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Simple Code Sample      KarstenJ   |   Edit   |   Show History
//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 What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker