-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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user