Esempio n. 1
0
        //[Benchmark]
        public void WriteNullUnescapedOverheadUtf16()
        {
            _arrayFormatterWrapper.Clear();

            var state = new JsonWriterState(options: new JsonWriterOptions {
                Indented = Formatted, SkipValidation = SkipValidation
            });

            var json = new Utf8JsonWriter2(_arrayFormatterWrapper, state);

            json.WriteStartObject();
            for (int i = 0; i < 100; i++)
            {
                json.WriteNull("first", suppressEscaping: false);
            }
            json.WriteEndObject();
            json.Flush();
        }