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