2using System.Globalization;
13 private readonly Utf8JsonWriter _writer;
21 _writer =
new Utf8JsonWriter(bufferWriter);
30 _writer =
new Utf8JsonWriter(stream);
46 await _writer.FlushAsync();
62 await _writer.DisposeAsync();
70 _writer.WriteStartObject();
78 _writer.WriteEndObject();
86 _writer.WriteStartObject();
88 _writer.WriteStartObject();
96 _writer.WriteEndObject();
97 _writer.WriteEndObject();
105 _writer.WriteStartArray();
113 _writer.WriteEndArray();
121 _writer.WriteStartObject();
123 _writer.WriteStartObject();
131 _writer.WriteEndObject();
132 _writer.WriteEndObject();
251 _writer.WritePropertyName(value);
308 _writer.WriteStringValue(value);
317 var str = value.ToString(
"yyyy-MM-dd");
327 var str = value.ToString(
"yyyy-MM-dd");
337 var str = value.ToString(
"yyyy-MM-dd");
347 var str = value.ToUniversalTime().ToString(
"o", CultureInfo.InvariantCulture);
357 var str = value.ToUniversalTime().ToString(
"o", CultureInfo.InvariantCulture);
367 _writer.WriteBooleanValue(value);
375 _writer.WriteNullValue();
Provides functionality for writing data in a streaming manner to a buffer or a stream.
void WriteNull(string fieldName)
Writes a null value with a specific field name.
void WriteNullValue()
Writes a null value to the stream.
void WriteEndEscapedObject()
Writes the end of a specially tagged object.
void WriteDateValue(DateTimeOffset value)
Writes a date value as a tagged element.
void WriteIntValue(int value)
Writes an integer value as a tagged element.
void WriteTaggedValue(string tag, string value)
Writes a tagged value in an object.
Utf8FaunaWriter(Stream stream)
Initializes a new instance of the Utf8FaunaWriter class with a specified stream.
void Dispose()
Disposes the underlying writer.
void WriteStartRef()
Writes the beginning of a reference object.
void WriteBooleanValue(bool value)
Writes a boolean value to the stream.
void WriteDate(string fieldName, DateTime value)
Writes a date value with a specific field name.
void WriteDateValue(DateOnly value)
Writes a date value as a tagged element.
void WriteFieldName(string value)
Writes a field name for the next value.
void WriteDouble(string fieldName, decimal value)
Writes a double value with a specific field name.
void WriteLong(string fieldName, long value)
Writes a long integer value with a specific field name.
void WriteString(string fieldName, string value)
Writes a string value with a specific field name.
void WriteDoubleValue(decimal value)
Writes a double value as a tagged element.
async ValueTask FlushAsync()
Asynchronously flushes the written data to the underlying buffer or stream.
void WriteTime(string fieldName, DateTime value)
Writes a time value with a specific field name.
void WriteStartArray()
Writes the beginning of an array.
void WriteEndArray()
Writes the end of an array.
void WriteLongValue(long value)
Writes a long integer value as a tagged element.
void WriteStartEscapedObject()
Writes the beginning of a specially tagged object.
void WriteDateValue(DateTime value)
Writes a date value as a tagged element.
void WriteDoubleValue(double value)
Writes a double value as a tagged element.
void WriteTimeValue(DateTime value)
Writes a date value as a tagged element.
void WriteModule(string fieldName, Module value)
Writes a module value with a specific field name.
void WriteStringValue(string value)
Writes a string value as a tagged element.
void WriteBoolean(string fieldName, bool value)
Writes a boolean value with a specific field name.
void WriteDouble(string fieldName, double value)
Writes a double value with a specific field name.
void WriteEndObject()
Writes the end of an object.
void WriteModuleValue(Module value)
Writes a module value as a tagged element.
void Flush()
Flushes the written data to the underlying buffer or stream.
async ValueTask DisposeAsync()
Asynchronously disposes the underlying writer.
void WriteInt(string fieldName, int value)
Writes an integer value with a specific field name.
Utf8FaunaWriter(IBufferWriter< byte > bufferWriter)
Initializes a new instance of the Utf8FaunaWriter class with a specified buffer writer.
void WriteTimeValue(DateTimeOffset value)
Writes a date value as a tagged element.
void WriteEndRef()
Writes the end of a reference object.
void WriteStartObject()
Writes the beginning of an object.
Represents a module, a singleton object grouping related functionalities. Modules are serialized as @...
string Name
Gets the name of the module. The name is used to identify and reference the module.