Class TabularSparseArrayHandler<T>
Reads an array of Nullable<T> from or writes an array of Nullable<T> to a tabular record. This class cannot be inherited.
public sealed class TabularSparseArrayHandler<T> : TabularHandler<T?[]> where T : struct
Type Parameters
T
The type of field value handled by the record handler.
- Inheritance
-
TabularHandler<T?[]>TabularSparseArrayHandler<T>
- Inherited Members
Constructors
TabularSparseArrayHandler(TabularConverter<T>)
Initializes a new instance of the TabularSparseArrayHandler<T> class with the specified converter.
public TabularSparseArrayHandler(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.