using (var writer = new BlittableJsonTextWriter(context)) { writer.WriteStartObject(); writer.WritePropertyName("isTrue"); writer.WriteBool(true); writer.WriteEndObject(); }
using (var writer = new BlittableJsonTextWriter(context)) { writer.WriteStartArray(); writer.WriteBool(true); writer.WriteBool(false); writer.WriteEndArray(); }In this example, we start writing a JSON array using the WriteStartArray method. Then, we call the WriteBool method twice passing the boolean values true and false to add them as array items. Finally, we call the WriteEndArray method to close the JSON array. Overall, the BlittableJsonTextWriter class is useful for efficiently writing JSON texts that can be easily converted back into objects.