-Rewrote JsonTextReader to use internal buffer to improve performance

-Improved JsonSerializer to cache contract/converters where possible to improve performance
-Improved JsonTextReader error message when additional JSON content found
-Fixed internal exception thrown when deserializing Decimal/DateTimeOffset/Byte lists
-Fixed various JsonTextReader bugs
This commit is contained in:
JamesNK
2012-01-16 06:53:41 +00:00
parent b00ff2d37b
commit faf6426527
32 changed files with 1971 additions and 509 deletions
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Newtonsoft.Json.Utilities
{
internal struct StringReference
{
private readonly char[] _chars;
private readonly int _startIndex;
private readonly int _length;
public char[] Chars
{
get { return _chars; }
}
public int StartIndex
{
get { return _startIndex; }
}
public int Length
{
get { return _length; }
}
public StringReference(char[] chars, int startIndex, int length)
{
_chars = chars;
_startIndex = startIndex;
_length = length;
}
public override string ToString()
{
return new string(_chars, _startIndex, _length);
}
}
}