-Changed BsonReader/BsonWriter to close the underlying stream by default when closed
-Added CloseInput/CloseOutput to JsonReader/JsonWriter to control whether the underlying stream is closed. Default to true
This commit is contained in:
@@ -117,6 +117,16 @@ namespace Newtonsoft.Json
|
||||
|
||||
private readonly List<JTokenType> _stack;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the underlying stream or
|
||||
/// <see cref="TextReader"/> should be closed when the reader is closed.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// true to close the underlying stream or <see cref="TextReader"/> when
|
||||
/// the reader is closed; otherwise false. The default is true.
|
||||
/// </value>
|
||||
public bool CloseInput { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the quotation mark character used to enclose the value of a string.
|
||||
/// </summary>
|
||||
@@ -173,6 +183,9 @@ namespace Newtonsoft.Json
|
||||
{
|
||||
_currentState = State.Start;
|
||||
_stack = new List<JTokenType>();
|
||||
|
||||
CloseInput = true;
|
||||
|
||||
Push(JTokenType.None);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user