예제 #1
0
        private static bool Write(
            ref JsonWriterState writerState,
            IBufferWriter <byte> bufferWriter,
            int flushThreshold,
            JsonSerializerOptions options,
            ref WriteStack state)
        {
            Utf8JsonWriter writer = new Utf8JsonWriter(bufferWriter, writerState);

            bool isFinalBlock = Write(
                ref writer,
                flushThreshold,
                options,
                ref state);

            writer.Flush(isFinalBlock: isFinalBlock);
            writerState = writer.GetCurrentState();

            return(isFinalBlock);
        }
예제 #2
0
        private static bool Write(
            ref JsonWriterState writerState,
            IBufferWriter <byte> bufferWriter,
            int flushThreshold,
            JsonSerializerOptions options,
            ref WriteObjectState current,
            ref List <WriteObjectState> previous,
            ref int arrayIndex)
        {
            Utf8JsonWriter writer = new Utf8JsonWriter(bufferWriter, writerState);

            bool isFinalBlock = Write(
                ref writer,
                flushThreshold,
                options,
                ref current,
                ref previous,
                ref arrayIndex);

            writer.Flush(isFinalBlock: isFinalBlock);
            writerState = writer.GetCurrentState();

            return(isFinalBlock);
        }