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>, MemoryPool<byte>?, CsvIOOptions)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<byte> Create(in ReadOnlySequence<byte> csv, MemoryPool<byte>? memoryPool = null, CsvIOOptions options = default)
Parameters
csvReadOnlySequence<byte>CSV data
memoryPoolMemoryPool<byte>optionsCsvIOOptions
Returns
Create(in ReadOnlySequence<char>, MemoryPool<char>?, CsvIOOptions)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<char> Create(in ReadOnlySequence<char> csv, MemoryPool<char>? memoryPool = null, CsvIOOptions options = default)
Parameters
csvReadOnlySequence<char>CSV data
memoryPoolMemoryPool<char>optionsCsvIOOptions
Returns
Create(Stream, MemoryPool<byte>?, CsvIOOptions)
Creates a new CSV reader instance from a Stream.
public static ICsvBufferReader<byte> Create(Stream stream, MemoryPool<byte>? memoryPool = null, CsvIOOptions options = default)
Parameters
streamStreamThe stream
memoryPoolMemoryPool<byte>Memory pool used; defaults to Shared.
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 NoDirectBufferAccess.
Create(Stream, Encoding?, MemoryPool<char>?, CsvIOOptions)
public static ICsvBufferReader<char> Create(Stream stream, Encoding? encoding = null, MemoryPool<char>? memoryPool = null, CsvIOOptions options = default)
Parameters
streamStreamThe stream
encodingEncodingEncoding used to read the bytes
memoryPoolMemoryPool<char>Memory pool used; defaults to Shared.
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, MemoryPool<char>?, CsvIOOptions)
Creates a new CSV reader instance from a TextReader.
public static ICsvBufferReader<char> Create(TextReader reader, MemoryPool<char>? memoryPool = null, CsvIOOptions options = default)
Parameters
readerTextReaderThe text reader
memoryPoolMemoryPool<char>Memory pool used; defaults to Shared.
optionsCsvIOOptionsOptions to configure the reader
Returns
Remarks
If the stream is a StringReader, the internal string is accessed directly for zero-copy reads; see NoDirectBufferAccess.
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?)
Creates a new reader over the CSV data.
public static ICsvBufferReader<char> Create(StringBuilder? csv)
Parameters
csvStringBuilderString builder containing the CSV
Returns
Remarks
The StringBuilder must not be modified while the reader is in use.
Create<T>(in ReadOnlySequence<T>, MemoryPool<T>?, CsvIOOptions)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<T> Create<T>(in ReadOnlySequence<T> csv, MemoryPool<T>? memoryPool = null, CsvIOOptions options = default) where T : unmanaged
Parameters
csvReadOnlySequence<T>CSV data
memoryPoolMemoryPool<T>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
Parameters
csvReadOnlyMemory<T>CSV data
Returns
Type Parameters
T