-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
+10 -2
View File
@@ -57,14 +57,22 @@ namespace Newtonsoft.Json.Utilities
{
// test if the buffer array is large enough to take the value
if (_position == _buffer.Length)
{
EnsureSize(1);
}
// set value and increment poisition
_buffer[_position++] = value;
}
public void Append(char[] buffer, int startIndex, int count)
{
if (_position + count >= _buffer.Length)
EnsureSize(count);
Array.Copy(buffer, startIndex, _buffer, _position, count);
_position += count;
}
public void Clear()
{
_buffer = _emptyBuffer;