Class TabularArrayHandler<T>
Reads an array of T
from or writes an array of T
to a tabular record. This class cannot be inherited.
public sealed class TabularArrayHandler<T> : TabularHandler<T?[]>
Type Parameters
T
The type of field value handled by the record handler.
- Inheritance
-
TabularHandler<T[]>TabularArrayHandler<T>
- Inherited Members
Constructors
TabularArrayHandler(TabularConverter<T?>)
Initializes a new instance of the TabularArrayHandler<T> class with the specified converter.
public TabularArrayHandler(TabularConverter<T?> converter)
Parameters
converter
TabularConverter<T>The converter to parse and format values with.
Exceptions
- ArgumentNullException
converter
is null.
Methods
Read(TabularReader)
When overridden in a derived class, reads the next record using the specified reader.
public override TabularRecord<T?[]> Read(TabularReader reader)
Parameters
reader
TabularReaderThe reader to read with.
Returns
- TabularRecord<T[]>
A container that may or may not have a record.
Remarks
Throws a NotSupportedException exception by default.
Exceptions
- ArgumentNullException
reader
is null.
ReadAsync(TabularReader, CancellationToken)
When overridden in a derived class, asynchronously reads the next record using the specified reader.
public override ValueTask<TabularRecord<T?[]>> ReadAsync(TabularReader reader, CancellationToken cancellationToken)
Parameters
reader
TabularReaderThe reader to read with.
cancellationToken
CancellationTokenThe token to monitor for cancellation requests.
Returns
- ValueTask<TabularRecord<T[]>>
A task object that, when awaited, produces a container that may or may not have a record.
Remarks
Throws a NotSupportedException exception by default.
Exceptions
- ArgumentNullException
reader
is null.
Write(TabularWriter, T?[])
When overridden in a derived class, writes the next record using the specified writer.
public override void Write(TabularWriter writer, T?[] record)
Parameters
writer
TabularWriterThe writer to write with.
record
T[]The object to write.
Remarks
Throws a NotSupportedException exception by default.
Exceptions
- ArgumentNullException
writer
orrecord
is null.
WriteAsync(TabularWriter, T?[], CancellationToken)
When overridden in a derived class, asynchronously writes the next record using the specified writer.
public override ValueTask WriteAsync(TabularWriter writer, T?[] record, CancellationToken cancellationToken)
Parameters
writer
TabularWriterThe writer to write with.
record
T[]The object to write.
cancellationToken
CancellationTokenThe token to monitor for cancellation requests.
Returns
- ValueTask
A task object.
Remarks
Throws a NotSupportedException exception by default.
Exceptions
- ArgumentNullException
writer
orrecord
is null.