示例#1
0
        public void WriteObject(BlittableJsonReaderObject obj)
        {
            WriteStartObject();
            var prop = new BlittableJsonReaderObject.PropertyDetails();

            for (int i = 0; i < obj.Count; i++)
            {
                if (i != 0)
                {
                    WriteComma();
                }
                obj.GetPropertyByIndex(i, ref prop);
                WritePropertyName(prop.Name);

                WriteValue(prop.Token & BlittableJsonReaderObject.TypesMask, prop.Value, originalPropertyOrder: false);
            }

            WriteEndObject();
        }
        public void WriteObjectOrdered(BlittableJsonReaderObject obj)
        {
            WriteStartObject();
            var props = obj.GetPropertiesByInsertionOrder();
            var prop  = new BlittableJsonReaderObject.PropertyDetails();

            for (int i = 0; i < props.Length; i++)
            {
                if (i != 0)
                {
                    WriteComma();
                }

                obj.GetPropertyByIndex(props[i], ref prop);
                WritePropertyName(prop.Name);

                WriteValue(prop.Token & BlittableJsonReaderBase.TypesMask, prop.Value, originalPropertyOrder: true);
            }

            WriteEndObject();
        }