-Refactored parsing dates

-Refactored writing integers
-Refactored JsonConvert
This commit is contained in:
James Newton-King
2013-04-21 18:27:08 +12:00
parent 2b357700f0
commit b6d3168ed8
41 changed files with 1335 additions and 572 deletions
+3 -4
View File
@@ -69,11 +69,10 @@ namespace Newtonsoft.Json.Tests
protected string GetOffset(DateTime d, DateFormatHandling dateFormatHandling)
{
StringWriter sw = new StringWriter();
JsonConvert.WriteDateTimeOffset(sw, DateTime.SpecifyKind(d, DateTimeKind.Local).GetUtcOffset(), dateFormatHandling);
sw.Flush();
char[] chars = new char[8];
int pos = DateTimeUtils.WriteDateTimeOffset(chars, 0, DateTime.SpecifyKind(d, DateTimeKind.Local).GetUtcOffset(), dateFormatHandling);
return sw.ToString();
return new string(chars, 0, pos);
}
protected string BytesToHex(byte[] bytes)