Ejemplo n.º 1
0
        public string Serialize(JsonWriter.Formatter formatter = null)
        {
            var builder = new StringBuilder(length);

            Serialize(builder, formatter);
            return(builder.ToString());
        }
Ejemplo n.º 2
0
        public void Serialize(StringBuilder builder, JsonWriter.Formatter formatter = null)
        {
            using (var sw = new StringWriter(builder, CultureInfo.InvariantCulture))
            {
                var writer = new JsonWriter(sw);
                writer.SetFormatter(formatter);

                Serialize(writer, this);
            }
        }