Table of Contents

Class TabularWriter

Namespace
Addax.Formats.Tabular
Assembly
Addax.Formats.Tabular.dll

Provides forward-only, write-only access to tabular data fields. This class cannot be inherited.

public sealed class TabularWriter : IDisposable, IAsyncDisposable
Inheritance
TabularWriter
Implements

Constructors

TabularWriter(Stream, TabularDialect, TabularOptions?)

Initializes a new instance of the TabularWriter class for the specified stream using the provided dialect and options.

public TabularWriter(Stream stream, TabularDialect dialect, TabularOptions? options = null)

Parameters

stream Stream

The stream to write to.

dialect TabularDialect

The dialect to use for writing.

options TabularOptions

The options to control the behavior during writing.

Exceptions

ArgumentException

stream does not support writing.

ArgumentNullException

stream or dialect is null.

Properties

BytesCommitted

Gets the number of bytes committed so far.

public long BytesCommitted { get; }

Property Value

long

A non-negative 64-bit signed integer.

Remarks

Might be greater than the number of bytes written to the underlying stream.

CurrentPositionType

Gets the type of the current writer position.

public TabularPositionType CurrentPositionType { get; }

Property Value

TabularPositionType

A position type enumeration value.

FieldsWritten

Gets the number of fields written to the current record so far.

public long FieldsWritten { get; }

Property Value

long

A non-negative 64-bit signed integer.

RecordsWritten

Gets the number of records written so far.

public long RecordsWritten { get; }

Property Value

long

A non-negative 64-bit signed integer.

Methods

Dispose()

Releases the resources used by the current instance of the TabularWriter class.

public void Dispose()

DisposeAsync()

Asynchronously releases the resources used by the current instance of the TabularWriter class.

public ValueTask DisposeAsync()

Returns

ValueTask

A task object.

FinishRecord()

Instructs the writer to finish accepting fields for the current record.

public void FinishRecord()

Flush()

Writes any buffered data to the underlying stream.

public void Flush()

FlushAsync(CancellationToken)

Asynchronously writes any buffered data to the underlying stream.

public ValueTask FlushAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteAnnotation(ReadOnlySpan<char>)

Writes a character sequence as the next record with annotation.

public void WriteAnnotation(ReadOnlySpan<char> value)

Parameters

value ReadOnlySpan<char>

A ReadOnlySpan<T> instance to write.

Exceptions

ArgumentException

The value cannot be formatted into a character sequence or the formatted value exceeds the supported field length.

InvalidOperationException

The current dialect does not support the operation.

WriteAnnotation(string?)

Writes a string instance as the next record with annotation.

public void WriteAnnotation(string? value)

Parameters

value string

A string instance to write.

Exceptions

ArgumentException

The value cannot be formatted into a character sequence or the formatted value exceeds the supported field length.

InvalidOperationException

The current dialect does not support the operation.

WriteAnnotationAsync(ReadOnlyMemory<char>, CancellationToken)

Asynchronously writes a character sequence as the next record with annotation.

public ValueTask WriteAnnotationAsync(ReadOnlyMemory<char> value, CancellationToken cancellationToken = default)

Parameters

value ReadOnlyMemory<char>

A ReadOnlyMemory<T> instance to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

ArgumentException

The value cannot be formatted into a character sequence or the formatted value exceeds the supported field length. This exception is stored into the returned task.

InvalidOperationException

The current dialect does not support the operation. This exception is stored into the returned task.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteAnnotationAsync(string?, CancellationToken)

Asynchronously writes a string instance as the next record with annotation.

public ValueTask WriteAnnotationAsync(string? value, CancellationToken cancellationToken = default)

Parameters

value string

A string instance to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

ArgumentException

The value cannot be formatted into a character sequence or the formatted value exceeds the supported field length. This exception is stored into the returned task.

InvalidOperationException

The current dialect does not support the operation. This exception is stored into the returned task.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteAsync<T>(T?, TabularConverter<T>, CancellationToken)

Asynchronously writes T value as the next value field of the current record.

public ValueTask WriteAsync<T>(T? value, TabularConverter<T> converter, CancellationToken cancellationToken = default)

Parameters

value T

T value to write.

converter TabularConverter<T>

The converter to format the value with.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Type Parameters

T

The type of the value to write.

Exceptions

ArgumentException

The formatted value exceeds the supported field length. This exception is stored into the returned task.

ArgumentNullException

converter is null.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteBase16Binary(byte[]?)

Writes binary data encoded with "base16" ("hex") encoding as the next value field of the current record.

public void WriteBase16Binary(byte[]? value)

Parameters

value byte[]

An array of bytes to write.

Remarks

The value will be formatted according to the RFC 4648.

Exceptions

ArgumentException

The formatted field exceeds the supported field length.

WriteBase16BinaryAsync(byte[]?, CancellationToken)

Asynchronously writes binary data encoded with "base16" ("hex") encoding as the next value field of the current record.

public ValueTask WriteBase16BinaryAsync(byte[]? value, CancellationToken cancellationToken = default)

Parameters

value byte[]

An array of bytes to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be formatted according to the RFC 4648.

Exceptions

FormatException

The value cannot be formatted into a character sequence. This exception is stored into the returned task.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteBase64Binary(byte[]?)

Writes binary data encoded with "base64" encoding as the next value field of the current record.

public void WriteBase64Binary(byte[]? value)

Parameters

value byte[]

An array of bytes to write.

Remarks

The value will be formatted according to the RFC 4648.

Exceptions

ArgumentException

The formatted field exceeds the supported field length.

WriteBase64BinaryAsync(byte[]?, CancellationToken)

Asynchronously writes binary data encoded with "base64" encoding as the next value field of the current record.

public ValueTask WriteBase64BinaryAsync(byte[]? value, CancellationToken cancellationToken = default)

Parameters

value byte[]

An array of bytes to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be formatted according to the RFC 4648.

Exceptions

FormatException

The value cannot be formatted into a character sequence. This exception is stored into the returned task.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteBigInteger(BigInteger)

Writes a BigInteger value as the next value field of the current record.

public void WriteBigInteger(BigInteger value)

Parameters

value BigInteger

A BigInteger value to write.

Exceptions

ArgumentException

The formatted field exceeds the supported field length.

WriteBigIntegerAsync(BigInteger, CancellationToken)

Asynchronously writes a BigInteger value as the next value field of the current record.

public ValueTask WriteBigIntegerAsync(BigInteger value, CancellationToken cancellationToken = default)

Parameters

value BigInteger

A BigInteger value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

FormatException

The value cannot be formatted into a character sequence. This exception is stored into the returned task.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteBoolean(bool)

Writes a bool value as the next value field of the current record.

public void WriteBoolean(bool value)

Parameters

value bool

A bool value to write.

Remarks

The value will be represented as one of the literals: "false", "true".

WriteBooleanAsync(bool, CancellationToken)

Asynchronously writes a bool value as the next value field of the current record.

public ValueTask WriteBooleanAsync(bool value, CancellationToken cancellationToken = default)

Parameters

value bool

A bool value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be represented as one of the literals: "false", "true".

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteByte(byte)

Writes a byte value as the next value field of the current record.

public void WriteByte(byte value)

Parameters

value byte

A byte value to write.

WriteByteAsync(byte, CancellationToken)

Asynchronously writes a byte value as the next value field of the current record.

public ValueTask WriteByteAsync(byte value, CancellationToken cancellationToken = default)

Parameters

value byte

A byte value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteChar(char)

Writes a char value as the next value field of the current record.

public void WriteChar(char value)

Parameters

value char

A char value to write.

WriteCharAsync(char, CancellationToken)

Asynchronously writes a char value as the next value field of the current record.

public ValueTask WriteCharAsync(char value, CancellationToken cancellationToken = default)

Parameters

value char

A char value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteDateOnly(DateOnly)

Writes a DateOnly value as the next value field of the current record.

public void WriteDateOnly(DateOnly value)

Parameters

value DateOnly

A DateOnly value to write.

Remarks

The value will be formatted according to the RFC 3339.

WriteDateOnlyAsync(DateOnly, CancellationToken)

Asynchronously writes a DateOnly value as the next value field of the current record.

public ValueTask WriteDateOnlyAsync(DateOnly value, CancellationToken cancellationToken = default)

Parameters

value DateOnly

A DateOnly value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be formatted according to the RFC 3339.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteDateTime(DateTime)

Writes a DateTime value as the next value field of the current record.

public void WriteDateTime(DateTime value)

Parameters

value DateTime

A DateTime value to write.

Remarks

The value will be formatted according to the RFC 3339.

WriteDateTimeAsync(DateTime, CancellationToken)

Asynchronously writes a DateTime value as the next value field of the current record.

public ValueTask WriteDateTimeAsync(DateTime value, CancellationToken cancellationToken = default)

Parameters

value DateTime

A DateTime value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be formatted according to the RFC 3339.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteDateTimeOffset(DateTimeOffset)

Writes a DateTimeOffset value as the next value field of the current record.

public void WriteDateTimeOffset(DateTimeOffset value)

Parameters

value DateTimeOffset

A DateTimeOffset value to write.

Remarks

The value will be formatted according to the RFC 3339.

WriteDateTimeOffsetAsync(DateTimeOffset, CancellationToken)

Asynchronously writes a DateTimeOffset value as the next value field of the current record.

public ValueTask WriteDateTimeOffsetAsync(DateTimeOffset value, CancellationToken cancellationToken = default)

Parameters

value DateTimeOffset

A DateTimeOffset value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be formatted according to the RFC 3339.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteDecimal(decimal)

Writes a decimal value as the next value field of the current record.

public void WriteDecimal(decimal value)

Parameters

value decimal

A decimal value to write.

WriteDecimalAsync(decimal, CancellationToken)

Asynchronously writes a decimal value as the next value field of the current record.

public ValueTask WriteDecimalAsync(decimal value, CancellationToken cancellationToken = default)

Parameters

value decimal

A decimal value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteDouble(double)

Writes a double value as the next value field of the current record.

public void WriteDouble(double value)

Parameters

value double

A double value to write.

WriteDoubleAsync(double, CancellationToken)

Asynchronously writes a double value as the next value field of the current record.

public ValueTask WriteDoubleAsync(double value, CancellationToken cancellationToken = default)

Parameters

value double

A double value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteEmpty()

Writes an empty character sequence as the next value field of the current record.

public void WriteEmpty()

WriteEmptyAsync(CancellationToken)

Asynchronously writes an empty character sequence as the next value field of the current record.

public ValueTask WriteEmptyAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteGuid(Guid)

Writes a Guid value as the next value field of the current record.

public void WriteGuid(Guid value)

Parameters

value Guid

A Guid value to write.

Remarks

The value will be formatted according to the RFC 4122.

WriteGuidAsync(Guid, CancellationToken)

Asynchronously writes a Guid value as the next value field of the current record.

public ValueTask WriteGuidAsync(Guid value, CancellationToken cancellationToken = default)

Parameters

value Guid

A Guid value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be formatted according to the RFC 4122.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteHalf(Half)

Writes a Half value as the next value field of the current record.

public void WriteHalf(Half value)

Parameters

value Half

A Half value to write.

WriteHalfAsync(Half, CancellationToken)

Asynchronously writes a Half value as the next value field of the current record.

public ValueTask WriteHalfAsync(Half value, CancellationToken cancellationToken = default)

Parameters

value Half

A Half value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteInt128(Int128)

Writes a Int128 value as the next value field of the current record.

public void WriteInt128(Int128 value)

Parameters

value Int128

An Int128 value to write.

WriteInt128Async(Int128, CancellationToken)

Asynchronously writes a Int128 value as the next value field of the current record.

public ValueTask WriteInt128Async(Int128 value, CancellationToken cancellationToken = default)

Parameters

value Int128

An Int128 value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteInt16(short)

Writes a short value as the next value field of the current record.

public void WriteInt16(short value)

Parameters

value short

A short value to write.

WriteInt16Async(short, CancellationToken)

Asynchronously writes a short value as the next value field of the current record.

public ValueTask WriteInt16Async(short value, CancellationToken cancellationToken = default)

Parameters

value short

A short value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteInt32(int)

Writes a int value as the next value field of the current record.

public void WriteInt32(int value)

Parameters

value int

An int value to write.

WriteInt32Async(int, CancellationToken)

Asynchronously writes a int value as the next value field of the current record.

public ValueTask WriteInt32Async(int value, CancellationToken cancellationToken = default)

Parameters

value int

An int value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteInt64(long)

Writes a long value as the next value field of the current record.

public void WriteInt64(long value)

Parameters

value long

A long value to write.

WriteInt64Async(long, CancellationToken)

Asynchronously writes a long value as the next value field of the current record.

public ValueTask WriteInt64Async(long value, CancellationToken cancellationToken = default)

Parameters

value long

A long value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteSByte(sbyte)

Writes a sbyte value as the next value field of the current record.

[CLSCompliant(false)]
public void WriteSByte(sbyte value)

Parameters

value sbyte

A sbyte value to write.

WriteSByteAsync(sbyte, CancellationToken)

Asynchronously writes a sbyte value as the next value field of the current record.

[CLSCompliant(false)]
public ValueTask WriteSByteAsync(sbyte value, CancellationToken cancellationToken = default)

Parameters

value sbyte

A sbyte value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteSingle(float)

Writes a float value as the next value field of the current record.

public void WriteSingle(float value)

Parameters

value float

A float value to write.

WriteSingleAsync(float, CancellationToken)

Asynchronously writes a float value as the next value field of the current record.

public ValueTask WriteSingleAsync(float value, CancellationToken cancellationToken = default)

Parameters

value float

A float value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteString(ReadOnlySpan<char>)

Writes a character sequence as the next value field of the current record.

public void WriteString(ReadOnlySpan<char> value)

Parameters

value ReadOnlySpan<char>

A ReadOnlySpan<T> instance to write.

Exceptions

ArgumentException

The formatted value exceeds the supported field length.

WriteString(string?)

Writes a string instance as the next value field of the current record.

public void WriteString(string? value)

Parameters

value string

A string instance to write.

Exceptions

ArgumentException

The formatted value exceeds the supported field length.

WriteStringAsync(ReadOnlyMemory<char>, CancellationToken)

Asynchronously writes a character sequence as the next value field of the current record.

public ValueTask WriteStringAsync(ReadOnlyMemory<char> value, CancellationToken cancellationToken = default)

Parameters

value ReadOnlyMemory<char>

A ReadOnlyMemory<T> instance to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

ArgumentException

The formatted value exceeds the supported field length. This exception is stored into the returned task.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteStringAsync(string?, CancellationToken)

Asynchronously writes a string instance as the next value field of the current record.

public ValueTask WriteStringAsync(string? value, CancellationToken cancellationToken = default)

Parameters

value string

A string instance to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

ArgumentException

The formatted value exceeds the supported field length. This exception is stored into the returned task.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteTimeOnly(TimeOnly)

Writes a TimeOnly value as the next value field of the current record.

public void WriteTimeOnly(TimeOnly value)

Parameters

value TimeOnly

A TimeOnly value to write.

Remarks

The value will be formatted according to the RFC 3339.

WriteTimeOnlyAsync(TimeOnly, CancellationToken)

Asynchronously writes a TimeOnly value as the next value field of the current record.

public ValueTask WriteTimeOnlyAsync(TimeOnly value, CancellationToken cancellationToken = default)

Parameters

value TimeOnly

A TimeOnly value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be formatted according to the RFC 3339.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteTimeSpan(TimeSpan)

Writes a TimeSpan value as the next value field of the current record.

public void WriteTimeSpan(TimeSpan value)

Parameters

value TimeSpan

A TimeSpan value to write.

Remarks

The value will be formatted according to the RFC 3339.

WriteTimeSpanAsync(TimeSpan, CancellationToken)

Asynchronously writes a TimeSpan value as the next value field of the current record.

public ValueTask WriteTimeSpanAsync(TimeSpan value, CancellationToken cancellationToken = default)

Parameters

value TimeSpan

A TimeSpan value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be formatted according to the RFC 3339.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteUInt128(UInt128)

Writes a UInt128 value as the next value field of the current record.

[CLSCompliant(false)]
public void WriteUInt128(UInt128 value)

Parameters

value UInt128

An UInt128 value to write.

WriteUInt128Async(UInt128, CancellationToken)

Asynchronously writes a UInt128 value as the next value field of the current record.

[CLSCompliant(false)]
public ValueTask WriteUInt128Async(UInt128 value, CancellationToken cancellationToken = default)

Parameters

value UInt128

An UInt128 value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteUInt16(ushort)

Writes a ushort value as the next value field of the current record.

[CLSCompliant(false)]
public void WriteUInt16(ushort value)

Parameters

value ushort

An ushort value to write.

WriteUInt16Async(ushort, CancellationToken)

Asynchronously writes a ushort value as the next value field of the current record.

[CLSCompliant(false)]
public ValueTask WriteUInt16Async(ushort value, CancellationToken cancellationToken = default)

Parameters

value ushort

An ushort value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteUInt32(uint)

Writes a uint value as the next value field of the current record.

[CLSCompliant(false)]
public void WriteUInt32(uint value)

Parameters

value uint

An uint value to write.

WriteUInt32Async(uint, CancellationToken)

Asynchronously writes a uint value as the next value field of the current record.

[CLSCompliant(false)]
public ValueTask WriteUInt32Async(uint value, CancellationToken cancellationToken = default)

Parameters

value uint

An uint value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteUInt64(ulong)

Writes a ulong value as the next value field of the current record.

[CLSCompliant(false)]
public void WriteUInt64(ulong value)

Parameters

value ulong

An ulong value to write.

WriteUInt64Async(ulong, CancellationToken)

Asynchronously writes a ulong value as the next value field of the current record.

[CLSCompliant(false)]
public ValueTask WriteUInt64Async(ulong value, CancellationToken cancellationToken = default)

Parameters

value ulong

An ulong value to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteUri(Uri?)

Writes an System.Uri instance as the next value field of the current record.

public void WriteUri(Uri? value)

Parameters

value Uri

An System.Uri instance to write.

Remarks

The value will be formatted according to the RFC 3986.

WriteUriAsync(Uri?, CancellationToken)

Asynchronously writes an System.Uri instance as the next value field of the current record.

public ValueTask WriteUriAsync(Uri? value, CancellationToken cancellationToken = default)

Parameters

value Uri

An System.Uri instance to write.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task object.

Remarks

The value will be formatted according to the RFC 3986.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

Write<T>(T?, TabularConverter<T>)

Writes T value as the next value field of the current record.

public void Write<T>(T? value, TabularConverter<T> converter)

Parameters

value T

T value to write.

converter TabularConverter<T>

The converter to format the value with.

Type Parameters

T

The type of the value to write.

Exceptions

ArgumentException

The formatted value exceeds the supported field length.

ArgumentNullException

converter is null.