1
<?xml version="1.0" encoding="utf-8"?>
2
<topic id="ReadingWritingJSON" revisionNumber="1">
3
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
5
<para>To manually read and write JSON Json.NET provides the
6
<codeEntityReference>T:Newtonsoft.Json.JsonReader</codeEntityReference>
8
<codeEntityReference>T:Newtonsoft.Json.JsonWriter</codeEntityReference> classes.</para>
12
<title>JsonTextReader and JsonTextWriter</title>
16
<para>JsonReader and JsonWriter are low level classes and used internally by Json.NET.
17
To quickly work with JSON either the serializer -
19
<linkText>Serializing and Deserializing JSON</linkText>
20
<linkUri>SerializingJSON.htm</linkUri>
21
<linkTarget>_self</linkTarget>
23
or using <externalLink>
24
<linkText>LINQ to JSON</linkText>
25
<linkUri>LINQtoJSON.htm</linkUri>
26
<linkTarget>_self</linkTarget>
27
</externalLink> is recommended.
31
<para><codeEntityReference>T:Newtonsoft.Json.JsonTextReader</codeEntityReference>
32
and <codeEntityReference>T:Newtonsoft.Json.JsonTextWriter</codeEntityReference>
33
are used to read and write JSON text.
34
The JsonTextWriter has a number of settings on it to control how JSON is formatted
35
when it is written. These options include formatting, indention character, indent
36
count and quote character.</para>
38
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ReadingAndWritingJsonTests.cs" region="ReadingAndWritingJsonText" title="Writing JSON with JsonTextWriter" />
40
<para>JsonTextReader has settings on it for reading different date formats and time zones, and
41
the culture used when reading text values.</para>
42
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ReadingAndWritingJsonTests.cs" region="ReadingJsonText" title="Reading JSON with JsonTextReader" />
46
<title>JTokenReader and JTokenWriter</title>
48
<para><codeEntityReference>T:Newtonsoft.Json.Linq.JTokenReader</codeEntityReference>
49
and <codeEntityReference>T:Newtonsoft.Json.Linq.JTokenWriter</codeEntityReference>
50
read and write LINQ to JSON objects. They are located in the
51
<codeEntityReference>N:Newtonsoft.Json.Linq</codeEntityReference>
52
namespace. These objects allow you to use LINQ to JSON objects with objects that
53
read and write JSON such as the JsonSerializer. For example you can deserialize
54
from a LINQ to JSON object into a regular .NET object and vice versa.</para>
55
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ReadingAndWritingJsonTests.cs" region="ReadingAndWritingJsonLinq" title="Deserializing with JTokenReader" />
59
<codeEntityReference>T:Newtonsoft.Json.JsonReader</codeEntityReference>
60
<codeEntityReference>T:Newtonsoft.Json.JsonWriter</codeEntityReference>
61
<codeEntityReference>T:Newtonsoft.Json.Linq.JTokenReader</codeEntityReference>
62
<codeEntityReference>T:Newtonsoft.Json.Linq.JTokenWriter</codeEntityReference>
63
<codeEntityReference>T:Newtonsoft.Json.Bson.BsonReader</codeEntityReference>
64
<codeEntityReference>T:Newtonsoft.Json.Bson.BsonWriter</codeEntityReference>
66
</developerConceptualDocument>
b'\\ No newline at end of file'