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
TThe 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
converterTabularConverter<T>The converter to parse and format values with.
Exceptions
- ArgumentNullException
converteris 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
readerTabularReaderThe 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
readeris 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
readerTabularReaderThe reader to read with.
cancellationTokenCancellationTokenThe 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
readeris 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
writerTabularWriterThe writer to write with.
recordT?[]The object to write.
Remarks
Throws a NotSupportedException exception by default.
Exceptions
- ArgumentNullException
writerorrecordis 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
writerTabularWriterThe writer to write with.
recordT?[]The object to write.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- ValueTask
A task object.
Remarks
Throws a NotSupportedException exception by default.
Exceptions
- ArgumentNullException
writerorrecordis null.