Class CsvBufferReader
Static class that can be used to create ICsvBufferReader<T> instances.
[EditorBrowsable(EditorBrowsableState.Advanced)]
public static class CsvBufferReader
- Inheritance
-
objectCsvBufferReader
Methods
Create(in ReadOnlySequence<byte>, in CsvIOOptions)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<byte> Create(in ReadOnlySequence<byte> csv, in CsvIOOptions options = default)
Parameters
csvReadOnlySequence<byte>CSV data
optionsCsvIOOptions
Returns
Create(in ReadOnlySequence<char>, in CsvIOOptions)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<char> Create(in ReadOnlySequence<char> csv, in CsvIOOptions options = default)
Parameters
csvReadOnlySequence<char>CSV data
optionsCsvIOOptions
Returns
Create(Stream, in CsvIOOptions)
Creates a new CSV reader instance from a Stream.
public static ICsvBufferReader<byte> Create(Stream stream, in CsvIOOptions options = default)
Parameters
streamStreamThe stream
optionsCsvIOOptionsOptions to configure the reader
Returns
Remarks
If the stream is a MemoryStream, the buffer is accessed directly for zero-copy reads if possible; see DisableOptimizations.
Create(Stream, Encoding?, in CsvIOOptions)
public static ICsvBufferReader<char> Create(Stream stream, Encoding? encoding = null, in CsvIOOptions options = default)
Parameters
streamStreamThe stream
encodingEncodingEncoding used to read the bytes
optionsCsvIOOptionsOptions to configure the reader
Returns
Remarks
If encoding is null, ASCII, or UTF8, a custom reader implementation is used for more performant reading. Use the overload with TextReader if this behavior is not desired.
Create(TextReader, in CsvIOOptions)
Creates a new CSV reader instance from a TextReader.
public static ICsvBufferReader<char> Create(TextReader reader, in CsvIOOptions options = default)
Parameters
readerTextReaderThe text reader
optionsCsvIOOptionsOptions to configure the reader
Returns
Remarks
If the stream is a StringReader, the internal string is accessed directly for zero-copy reads; see DisableOptimizations.
Create(ReadOnlyMemory<byte>)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<byte> Create(ReadOnlyMemory<byte> csv)
Parameters
csvReadOnlyMemory<byte>CSV data
Returns
Create(ReadOnlyMemory<char>)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<char> Create(ReadOnlyMemory<char> csv)
Parameters
csvReadOnlyMemory<char>CSV data
Returns
Create(string?)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<char> Create(string? csv)
Parameters
csvstringCSV data
Returns
Create(StringBuilder?, in CsvIOOptions)
Creates a new reader over the CSV data.
public static ICsvBufferReader<char> Create(StringBuilder? csv, in CsvIOOptions options = default)
Parameters
csvStringBuilderString builder containing the CSV
optionsCsvIOOptionsOptions to configure the reader
Returns
Remarks
The StringBuilder must not be modified while the reader is in use.
Create<T>(in ReadOnlySequence<T>, in CsvIOOptions)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<T> Create<T>(in ReadOnlySequence<T> csv, in CsvIOOptions options = default) where T : unmanaged, IBinaryInteger<T>
Parameters
csvReadOnlySequence<T>CSV data
optionsCsvIOOptions
Returns
Type Parameters
T
Create<T>(ReadOnlyMemory<T>)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<T> Create<T>(ReadOnlyMemory<T> csv) where T : unmanaged, IBinaryInteger<T>
Parameters
csvReadOnlyMemory<T>CSV data
Returns
Type Parameters
T