-Added support for reading GUID strings as bytes in JsonTextReader
-Changed reading GUIDs as bytes to only support 00000000-0000-0000-0000-000000000000 format
This commit is contained in:
@@ -117,11 +117,16 @@ namespace Newtonsoft.Json
|
||||
|
||||
if (_readType == ReadType.ReadAsBytes)
|
||||
{
|
||||
Guid g;
|
||||
byte[] data;
|
||||
if (_stringReference.Length == 0)
|
||||
{
|
||||
data = new byte[0];
|
||||
}
|
||||
else if (_stringReference.Length == 36 && ConvertUtils.TryConvertGuid(_stringReference.ToString(), out g))
|
||||
{
|
||||
data = g.ToByteArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
data = Convert.FromBase64CharArray(_stringReference.Chars, _stringReference.StartIndex, _stringReference.Length);
|
||||
|
||||
Reference in New Issue
Block a user