public string Serialize(JsonWriter.Formatter formatter = null) { var builder = new StringBuilder(length); Serialize(builder, formatter); return(builder.ToString()); }
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); } }