Newtonsoft.Json.JsonTextReader.SetCharBuffer C# (CSharp) Method

SetCharBuffer() private method

private SetCharBuffer ( char chars ) : void
chars char
return void
        internal void SetCharBuffer(char[] chars)
        {
            _chars = chars;
        }
#endif

Usage Example

コード例 #1
0
    public void AppendCharsWhileReadingNewLine()
    {
      string json = @"
{
  ""description"": ""A person"",
  ""type"": ""object"",
  ""properties"":
  {
    ""name"": {""type"":""string""},
    ""hobbies"": {
      ""type"": ""array"",
      ""items"": {""type"":""string""}
    }
  }
}
";

      JsonTextReader reader = new JsonTextReader(new StringReader(json));
#if DEBUG
      reader.SetCharBuffer(new char[129]);
#endif

      for (int i = 0; i < 14; i++)
      {
        Assert.IsTrue(reader.Read());
      }

      Assert.IsTrue(reader.Read());
      Assert.AreEqual(JsonToken.PropertyName, reader.TokenType);
      Assert.AreEqual("type", reader.Value);
    }
All Usage Examples Of Newtonsoft.Json.JsonTextReader::SetCharBuffer