Replace "stream" in reader/writer classes' comments

XML documentation comments for JsonReader, JsonWriter and derived
classes often mention "underlying streams". In most cases however,
these types don't operate directly on Streams, but through other types
such as TextReader and TextWriter.

This commit changes these comments to reflect more accurately what
kind of objects the various JSON reader / writer classes operate on.

Additionally the effect of JsonReader.CloseInput and JsonWriter.Close-
Output is made more explicit in the comments for the Close methods.
This commit is contained in:
stakx
2016-12-24 02:26:16 +01:00
parent cf6a917a46
commit 1eb391c147
10 changed files with 62 additions and 57 deletions
+6 -5
View File
@@ -122,7 +122,7 @@ namespace Newtonsoft.Json.Bson
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BsonReader"/> class. /// Initializes a new instance of the <see cref="BsonReader"/> class.
/// </summary> /// </summary>
/// <param name="stream">The stream.</param> /// <param name="stream">The <see cref="Stream"/> containing the BSON data to read.</param>
public BsonReader(Stream stream) public BsonReader(Stream stream)
: this(stream, false, DateTimeKind.Local) : this(stream, false, DateTimeKind.Local)
{ {
@@ -131,7 +131,7 @@ namespace Newtonsoft.Json.Bson
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BsonReader"/> class. /// Initializes a new instance of the <see cref="BsonReader"/> class.
/// </summary> /// </summary>
/// <param name="reader">The reader.</param> /// <param name="reader">The <see cref="BinaryReader"/> containing the BSON data to read.</param>
public BsonReader(BinaryReader reader) public BsonReader(BinaryReader reader)
: this(reader, false, DateTimeKind.Local) : this(reader, false, DateTimeKind.Local)
{ {
@@ -140,7 +140,7 @@ namespace Newtonsoft.Json.Bson
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BsonReader"/> class. /// Initializes a new instance of the <see cref="BsonReader"/> class.
/// </summary> /// </summary>
/// <param name="stream">The stream.</param> /// <param name="stream">The <see cref="Stream"/> containing the BSON data to read.</param>
/// <param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param> /// <param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param>
/// <param name="dateTimeKindHandling">The <see cref="DateTimeKind" /> used when reading <see cref="DateTime"/> values from BSON.</param> /// <param name="dateTimeKindHandling">The <see cref="DateTimeKind" /> used when reading <see cref="DateTime"/> values from BSON.</param>
public BsonReader(Stream stream, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling) public BsonReader(Stream stream, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling)
@@ -155,7 +155,7 @@ namespace Newtonsoft.Json.Bson
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BsonReader"/> class. /// Initializes a new instance of the <see cref="BsonReader"/> class.
/// </summary> /// </summary>
/// <param name="reader">The reader.</param> /// <param name="reader">The <see cref="BinaryReader"/> containing the BSON data to read.</param>
/// <param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param> /// <param name="readRootValueAsArray">if set to <c>true</c> the root object will be read as a JSON array.</param>
/// <param name="dateTimeKindHandling">The <see cref="DateTimeKind" /> used when reading <see cref="DateTime"/> values from BSON.</param> /// <param name="dateTimeKindHandling">The <see cref="DateTimeKind" /> used when reading <see cref="DateTime"/> values from BSON.</param>
public BsonReader(BinaryReader reader, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling) public BsonReader(BinaryReader reader, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling)
@@ -175,7 +175,7 @@ namespace Newtonsoft.Json.Bson
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream. /// Reads the next JSON token from the underlying <see cref="Stream"/>.
/// </summary> /// </summary>
/// <returns> /// <returns>
/// <c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read. /// <c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
@@ -224,6 +224,7 @@ namespace Newtonsoft.Json.Bson
/// <summary> /// <summary>
/// Changes the reader's state to <see cref="JsonReader.State.Closed"/>. /// Changes the reader's state to <see cref="JsonReader.State.Closed"/>.
/// If <see cref="JsonReader.CloseInput"/> is set to <c>true</c>, the underlying <see cref="Stream"/> is also closed.
/// </summary> /// </summary>
public override void Close() public override void Close()
{ {
+5 -4
View File
@@ -62,7 +62,7 @@ namespace Newtonsoft.Json.Bson
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BsonWriter"/> class. /// Initializes a new instance of the <see cref="BsonWriter"/> class.
/// </summary> /// </summary>
/// <param name="stream">The stream.</param> /// <param name="stream">The <see cref="Stream"/> to write to.</param>
public BsonWriter(Stream stream) public BsonWriter(Stream stream)
{ {
ValidationUtils.ArgumentNotNull(stream, nameof(stream)); ValidationUtils.ArgumentNotNull(stream, nameof(stream));
@@ -72,7 +72,7 @@ namespace Newtonsoft.Json.Bson
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BsonWriter"/> class. /// Initializes a new instance of the <see cref="BsonWriter"/> class.
/// </summary> /// </summary>
/// <param name="writer">The writer.</param> /// <param name="writer">The <see cref="BinaryWriter"/> to write to.</param>
public BsonWriter(BinaryWriter writer) public BsonWriter(BinaryWriter writer)
{ {
ValidationUtils.ArgumentNotNull(writer, nameof(writer)); ValidationUtils.ArgumentNotNull(writer, nameof(writer));
@@ -80,7 +80,7 @@ namespace Newtonsoft.Json.Bson
} }
/// <summary> /// <summary>
/// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. /// Flushes whatever is in the buffer to the underlying <see cref="Stream"/> and also flushes the underlying stream.
/// </summary> /// </summary>
public override void Flush() public override void Flush()
{ {
@@ -170,7 +170,8 @@ namespace Newtonsoft.Json.Bson
} }
/// <summary> /// <summary>
/// Closes this stream and the underlying stream. /// Closes this writer.
/// If <see cref="JsonWriter.CloseOutput"/> is set to <c>true</c>, the underlying <see cref="Stream"/> is also closed.
/// </summary> /// </summary>
public override void Close() public override void Close()
{ {
+12 -13
View File
@@ -141,12 +141,10 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether the underlying stream or /// Gets or sets a value indicating whether the source should be closed when this reader is closed.
/// <see cref="TextReader"/> should be closed when the reader is closed.
/// </summary> /// </summary>
/// <value> /// <value>
/// <c>true</c> to close the underlying stream or <see cref="TextReader"/> when /// <c>true</c> to close the source when this reader is closed; otherwise <c>false</c>. The default is <c>true</c>.
/// the reader is closed; otherwise <c>false</c>. The default is <c>true</c>.
/// </value> /// </value>
public bool CloseInput { get; set; } public bool CloseInput { get; set; }
@@ -406,13 +404,13 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream. /// Reads the next JSON token from the source.
/// </summary> /// </summary>
/// <returns><c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.</returns> /// <returns><c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.</returns>
public abstract bool Read(); public abstract bool Read();
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Int32"/>. /// Reads the next JSON token from the source as a <see cref="Nullable{T}"/> of <see cref="Int32"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Int32"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Int32"/>. This method will return <c>null</c> at the end of an array.</returns>
public virtual int? ReadAsInt32() public virtual int? ReadAsInt32()
@@ -463,7 +461,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="String"/>. /// Reads the next JSON token from the source as a <see cref="String"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="String"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="String"/>. This method will return <c>null</c> at the end of an array.</returns>
public virtual string ReadAsString() public virtual string ReadAsString()
@@ -507,7 +505,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Byte"/>[]. /// Reads the next JSON token from the source as a <see cref="Byte"/>[].
/// </summary> /// </summary>
/// <returns>A <see cref="Byte"/>[] or <c>null</c> if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Byte"/>[] or <c>null</c> if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
public virtual byte[] ReadAsBytes() public virtual byte[] ReadAsBytes()
@@ -606,7 +604,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Double"/>. /// Reads the next JSON token from the source as a <see cref="Nullable{T}"/> of <see cref="Double"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Double"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Double"/>. This method will return <c>null</c> at the end of an array.</returns>
public virtual double? ReadAsDouble() public virtual double? ReadAsDouble()
@@ -668,7 +666,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Boolean"/>. /// Reads the next JSON token from the source as a <see cref="Nullable{T}"/> of <see cref="Boolean"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Boolean"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Boolean"/>. This method will return <c>null</c> at the end of an array.</returns>
public virtual bool? ReadAsBoolean() public virtual bool? ReadAsBoolean()
@@ -729,7 +727,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Decimal"/>. /// Reads the next JSON token from the source as a <see cref="Nullable{T}"/> of <see cref="Decimal"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Decimal"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Decimal"/>. This method will return <c>null</c> at the end of an array.</returns>
public virtual decimal? ReadAsDecimal() public virtual decimal? ReadAsDecimal()
@@ -779,7 +777,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="DateTime"/>. /// Reads the next JSON token from the source as a <see cref="Nullable{T}"/> of <see cref="DateTime"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTime"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTime"/>. This method will return <c>null</c> at the end of an array.</returns>
public virtual DateTime? ReadAsDateTime() public virtual DateTime? ReadAsDateTime()
@@ -835,7 +833,7 @@ namespace Newtonsoft.Json
#if !NET20 #if !NET20
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>. /// Reads the next JSON token from the source as a <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>. This method will return <c>null</c> at the end of an array.</returns>
public virtual DateTimeOffset? ReadAsDateTimeOffset() public virtual DateTimeOffset? ReadAsDateTimeOffset()
@@ -1124,6 +1122,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Changes the reader's state to <see cref="JsonReader.State.Closed"/>. /// Changes the reader's state to <see cref="JsonReader.State.Closed"/>.
/// If <see cref="JsonReader.CloseInput"/> is set to <c>true</c>, the source is also closed.
/// </summary> /// </summary>
public virtual void Close() public virtual void Close()
{ {
+4 -4
View File
@@ -994,7 +994,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Serializes the specified <see cref="Object"/> and writes the JSON structure /// Serializes the specified <see cref="Object"/> and writes the JSON structure
/// to a <see cref="Stream"/> using the specified <see cref="TextWriter"/>. /// using the specified <see cref="TextWriter"/>.
/// </summary> /// </summary>
/// <param name="textWriter">The <see cref="TextWriter"/> used to write the JSON structure.</param> /// <param name="textWriter">The <see cref="TextWriter"/> used to write the JSON structure.</param>
/// <param name="value">The <see cref="Object"/> to serialize.</param> /// <param name="value">The <see cref="Object"/> to serialize.</param>
@@ -1005,7 +1005,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Serializes the specified <see cref="Object"/> and writes the JSON structure /// Serializes the specified <see cref="Object"/> and writes the JSON structure
/// to a <see cref="Stream"/> using the specified <see cref="TextWriter"/>. /// using the specified <see cref="JsonWriter"/>.
/// </summary> /// </summary>
/// <param name="jsonWriter">The <see cref="JsonWriter"/> used to write the JSON structure.</param> /// <param name="jsonWriter">The <see cref="JsonWriter"/> used to write the JSON structure.</param>
/// <param name="value">The <see cref="Object"/> to serialize.</param> /// <param name="value">The <see cref="Object"/> to serialize.</param>
@@ -1021,7 +1021,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Serializes the specified <see cref="Object"/> and writes the JSON structure /// Serializes the specified <see cref="Object"/> and writes the JSON structure
/// to a <c>Stream</c> using the specified <see cref="TextWriter"/>. /// using the specified <see cref="TextWriter"/>.
/// </summary> /// </summary>
/// <param name="textWriter">The <see cref="TextWriter"/> used to write the JSON structure.</param> /// <param name="textWriter">The <see cref="TextWriter"/> used to write the JSON structure.</param>
/// <param name="value">The <see cref="Object"/> to serialize.</param> /// <param name="value">The <see cref="Object"/> to serialize.</param>
@@ -1037,7 +1037,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Serializes the specified <see cref="Object"/> and writes the JSON structure /// Serializes the specified <see cref="Object"/> and writes the JSON structure
/// to a <c>Stream</c> using the specified <see cref="JsonWriter"/>. /// using the specified <see cref="JsonWriter"/>.
/// </summary> /// </summary>
/// <param name="jsonWriter">The <see cref="JsonWriter"/> used to write the JSON structure.</param> /// <param name="jsonWriter">The <see cref="JsonWriter"/> used to write the JSON structure.</param>
/// <param name="value">The <see cref="Object"/> to serialize.</param> /// <param name="value">The <see cref="Object"/> to serialize.</param>
+10 -9
View File
@@ -359,7 +359,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream. /// Reads the next JSON token from the underlying <see cref="TextReader"/>.
/// </summary> /// </summary>
/// <returns> /// <returns>
/// <c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read. /// <c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
@@ -416,7 +416,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Int32"/>. /// Reads the next JSON token from the underlying <see cref="TextReader"/> as a <see cref="Nullable{T}"/> of <see cref="Int32"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Int32"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Int32"/>. This method will return <c>null</c> at the end of an array.</returns>
public override int? ReadAsInt32() public override int? ReadAsInt32()
@@ -425,7 +425,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="DateTime"/>. /// Reads the next JSON token from the underlying <see cref="TextReader"/> as a <see cref="Nullable{T}"/> of <see cref="DateTime"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTime"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTime"/>. This method will return <c>null</c> at the end of an array.</returns>
public override DateTime? ReadAsDateTime() public override DateTime? ReadAsDateTime()
@@ -434,7 +434,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="String"/>. /// Reads the next JSON token from the underlying <see cref="TextReader"/> as a <see cref="String"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="String"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="String"/>. This method will return <c>null</c> at the end of an array.</returns>
public override string ReadAsString() public override string ReadAsString()
@@ -443,7 +443,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Byte"/>[]. /// Reads the next JSON token from the underlying <see cref="TextReader"/> as a <see cref="Byte"/>[].
/// </summary> /// </summary>
/// <returns>A <see cref="Byte"/>[] or <c>null</c> if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Byte"/>[] or <c>null</c> if the next JSON token is null. This method will return <c>null</c> at the end of an array.</returns>
public override byte[] ReadAsBytes() public override byte[] ReadAsBytes()
@@ -697,7 +697,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Boolean"/>. /// Reads the next JSON token from the underlying <see cref="TextReader"/> as a <see cref="Nullable{T}"/> of <see cref="Boolean"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Boolean"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Boolean"/>. This method will return <c>null</c> at the end of an array.</returns>
public override bool? ReadAsBoolean() public override bool? ReadAsBoolean()
@@ -945,7 +945,7 @@ namespace Newtonsoft.Json
#if !NET20 #if !NET20
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>. /// Reads the next JSON token from the underlying <see cref="TextReader"/> as a <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>. This method will return <c>null</c> at the end of an array.</returns>
public override DateTimeOffset? ReadAsDateTimeOffset() public override DateTimeOffset? ReadAsDateTimeOffset()
@@ -955,7 +955,7 @@ namespace Newtonsoft.Json
#endif #endif
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Decimal"/>. /// Reads the next JSON token from the underlying <see cref="TextReader"/> as a <see cref="Nullable{T}"/> of <see cref="Decimal"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Decimal"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Decimal"/>. This method will return <c>null</c> at the end of an array.</returns>
public override decimal? ReadAsDecimal() public override decimal? ReadAsDecimal()
@@ -964,7 +964,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Double"/>. /// Reads the next JSON token from the underlying <see cref="TextReader"/> as a <see cref="Nullable{T}"/> of <see cref="Double"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Double"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Double"/>. This method will return <c>null</c> at the end of an array.</returns>
public override double? ReadAsDouble() public override double? ReadAsDouble()
@@ -2402,6 +2402,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// Changes the reader's state to <see cref="JsonReader.State.Closed"/>. /// Changes the reader's state to <see cref="JsonReader.State.Closed"/>.
/// If <see cref="JsonReader.CloseInput"/> is set to <c>true</c>, the underlying <see cref="TextReader"/> is also closed.
/// </summary> /// </summary>
public override void Close() public override void Close()
{ {
+3 -2
View File
@@ -163,7 +163,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. /// Flushes whatever is in the buffer to the underlying <see cref="TextWriter"/> and also flushes the underlying <see cref="TextWriter"/>.
/// </summary> /// </summary>
public override void Flush() public override void Flush()
{ {
@@ -171,7 +171,8 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Closes this stream and the underlying stream. /// Closes this writer.
/// If <see cref="JsonWriter.CloseOutput"/> is set to <c>true</c>, the underlying <see cref="TextWriter"/> is also closed.
/// </summary> /// </summary>
public override void Close() public override void Close()
{ {
+9 -9
View File
@@ -392,7 +392,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Int32"/>. /// Reads the next JSON token from the underlying <see cref="JsonReader"/> as a <see cref="Nullable{T}"/> of <see cref="Int32"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Int32"/>.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Int32"/>.</returns>
public override int? ReadAsInt32() public override int? ReadAsInt32()
@@ -404,7 +404,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Byte"/>[]. /// Reads the next JSON token from the underlying <see cref="JsonReader"/> as a <see cref="Byte"/>[].
/// </summary> /// </summary>
/// <returns> /// <returns>
/// A <see cref="Byte"/>[] or <c>null</c> if the next JSON token is null. /// A <see cref="Byte"/>[] or <c>null</c> if the next JSON token is null.
@@ -418,7 +418,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Decimal"/>. /// Reads the next JSON token from the underlying <see cref="JsonReader"/> as a <see cref="Nullable{T}"/> of <see cref="Decimal"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Decimal"/>.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Decimal"/>.</returns>
public override decimal? ReadAsDecimal() public override decimal? ReadAsDecimal()
@@ -430,7 +430,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Double"/>. /// Reads the next JSON token from the underlying <see cref="JsonReader"/> as a <see cref="Nullable{T}"/> of <see cref="Double"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Double"/>.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Double"/>.</returns>
public override double? ReadAsDouble() public override double? ReadAsDouble()
@@ -442,7 +442,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="Boolean"/>. /// Reads the next JSON token from the underlying <see cref="JsonReader"/> as a <see cref="Nullable{T}"/> of <see cref="Boolean"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="Boolean"/>.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="Boolean"/>.</returns>
public override bool? ReadAsBoolean() public override bool? ReadAsBoolean()
@@ -454,7 +454,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="String"/>. /// Reads the next JSON token from the underlying <see cref="JsonReader"/> as a <see cref="String"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="String"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="String"/>. This method will return <c>null</c> at the end of an array.</returns>
public override string ReadAsString() public override string ReadAsString()
@@ -466,7 +466,7 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="DateTime"/>. /// Reads the next JSON token from the underlying <see cref="JsonReader"/> as a <see cref="Nullable{T}"/> of <see cref="DateTime"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTime"/>. This method will return <c>null</c> at the end of an array.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTime"/>. This method will return <c>null</c> at the end of an array.</returns>
public override DateTime? ReadAsDateTime() public override DateTime? ReadAsDateTime()
@@ -479,7 +479,7 @@ namespace Newtonsoft.Json
#if !NET20 #if !NET20
/// <summary> /// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>. /// Reads the next JSON token from the underlying <see cref="JsonReader"/> as a <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>.
/// </summary> /// </summary>
/// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>.</returns> /// <returns>A <see cref="Nullable{T}"/> of <see cref="DateTimeOffset"/>.</returns>
public override DateTimeOffset? ReadAsDateTimeOffset() public override DateTimeOffset? ReadAsDateTimeOffset()
@@ -492,7 +492,7 @@ namespace Newtonsoft.Json
#endif #endif
/// <summary> /// <summary>
/// Reads the next JSON token from the stream. /// Reads the next JSON token from the underlying <see cref="JsonReader"/>.
/// </summary> /// </summary>
/// <returns> /// <returns>
/// <c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read. /// <c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
+5 -6
View File
@@ -119,12 +119,10 @@ namespace Newtonsoft.Json
private Formatting _formatting; private Formatting _formatting;
/// <summary> /// <summary>
/// Gets or sets a value indicating whether the underlying stream or /// Gets or sets a value indicating whether the destination should be closed when this writer is closed.
/// <see cref="TextReader"/> should be closed when the writer is closed.
/// </summary> /// </summary>
/// <value> /// <value>
/// <c>true</c> to close the underlying stream or <see cref="TextReader"/> when /// <c>true</c> to close the destination when this writer is closed; otherwise <c>false</c>. The default is <c>true</c>.
/// the writer is closed; otherwise <c>false</c>. The default is <c>true</c>.
/// </value> /// </value>
public bool CloseOutput { get; set; } public bool CloseOutput { get; set; }
@@ -389,12 +387,13 @@ namespace Newtonsoft.Json
} }
/// <summary> /// <summary>
/// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. /// Flushes whatever is in the buffer to the destination and also flushes the destination.
/// </summary> /// </summary>
public abstract void Flush(); public abstract void Flush();
/// <summary> /// <summary>
/// Closes this stream and the underlying stream. /// Closes this writer.
/// If <see cref="JsonWriter.CloseOutput"/> is set to <c>true</c>, the destination is also closed.
/// </summary> /// </summary>
public virtual void Close() public virtual void Close()
{ {
+1 -1
View File
@@ -65,7 +65,7 @@ namespace Newtonsoft.Json.Linq
} }
/// <summary> /// <summary>
/// Reads the next JSON token from the stream. /// Reads the next JSON token from the underlying <see cref="JToken"/>.
/// </summary> /// </summary>
/// <returns> /// <returns>
/// <c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read. /// <c>true</c> if the next token was read successfully; <c>false</c> if there are no more tokens to read.
+7 -4
View File
@@ -52,9 +52,9 @@ namespace Newtonsoft.Json.Linq
} }
/// <summary> /// <summary>
/// Gets the token being writen. /// Gets the token being written.
/// </summary> /// </summary>
/// <value>The token being writen.</value> /// <value>The token being written.</value>
public JToken Token public JToken Token
{ {
get get
@@ -88,15 +88,18 @@ namespace Newtonsoft.Json.Linq
} }
/// <summary> /// <summary>
/// Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. /// Flushes whatever is in the buffer to the underlying <see cref="JContainer"/>.
/// </summary> /// </summary>
public override void Flush() public override void Flush()
{ {
} }
/// <summary> /// <summary>
/// Closes this stream and the underlying stream. /// Closes this writer.
/// </summary> /// </summary>
/// <remarks>
/// Setting <see cref="JsonWriter.CloseOutput"/> to <c>true</c> has no additional effect, since the underlying <see cref="JContainer"/> is a type that cannot be closed.
/// </remarks>
public override void Close() public override void Close()
{ {
base.Close(); base.Close();