-Added reading and writing binary JSON (BSON) support - work in progress
-Added BsonReader, BsonWriter -Added support for reading and writing byte arrays to JsonReader, JsonWriter and LINQ to JSON classes -Added ReadAsBytes to JsonReader -Changed Silverlight build serializer to look for a TypeConverter -Changed .NET build to not rely on System.ComponentModel.DataAnnotations assembly to support .NET 4.0 client profile -Remove DateTimeOffset stand-in from Compact Framework build -Fixed .NET 2.0 build to run on environments without .NET 2.0 SP1 -Fixed deserialization to always use a new value created from a JsonConverter -Fixed XmlNodeConverter to support converting comments in JSON
This commit is contained in:
@@ -169,7 +169,7 @@ namespace Newtonsoft.Json
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JsonReader"/> class with the specified <see cref="TextReader"/>.
|
||||
/// </summary>
|
||||
public JsonReader()
|
||||
protected JsonReader()
|
||||
{
|
||||
//_testBuffer = new StringBuilder();
|
||||
_currentState = State.Start;
|
||||
@@ -204,6 +204,8 @@ namespace Newtonsoft.Json
|
||||
/// <returns>true if the next token was read successfully; false if there are no more tokens to read.</returns>
|
||||
public abstract bool Read();
|
||||
|
||||
public abstract byte[] ReadAsBytes();
|
||||
|
||||
/// <summary>
|
||||
/// Skips the children of the current token.
|
||||
/// </summary>
|
||||
@@ -275,6 +277,7 @@ namespace Newtonsoft.Json
|
||||
case JsonToken.Date:
|
||||
case JsonToken.String:
|
||||
case JsonToken.Raw:
|
||||
case JsonToken.Bytes:
|
||||
_currentState = State.PostValue;
|
||||
break;
|
||||
}
|
||||
@@ -351,6 +354,7 @@ namespace Newtonsoft.Json
|
||||
case JsonToken.EndConstructor:
|
||||
case JsonToken.Date:
|
||||
case JsonToken.Raw:
|
||||
case JsonToken.Bytes:
|
||||
return false;
|
||||
default:
|
||||
throw MiscellaneousUtils.CreateArgumentOutOfRangeException("token", token, "Unexpected JsonToken value.");
|
||||
|
||||
Reference in New Issue
Block a user