• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class LineReader

Reads lines from a stream, handling CRLF, LF, and CR line endings, and optional line unfolding (continuation lines) per RFC 5322 (MIME) or RFC 5545/6350 (iCal/vCard).

Inheritance
object
LineReader
Implements
IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Mail.Rfc.Shared
Assembly: DRIT.Mail.dll
Syntax
public sealed class LineReader : IDisposable

Constructors

View Source

LineReader(Stream, Encoding?, LineFoldingMode, bool)

Initializes a new instance of the LineReader class.

Declaration
public LineReader(Stream stream, Encoding? encoding = null, LineFoldingMode foldingMode = LineFoldingMode.None, bool leaveOpen = false)
Parameters
Type Name Description
Stream stream

The stream to read from.

Encoding encoding

The encoding used to decode bytes to strings. Defaults to UTF-8.

LineFoldingMode foldingMode

The line folding (unfolding) mode to apply.

bool leaveOpen

If true, the underlying stream is left open when this reader is disposed.

Properties

View Source

Position

Gets the approximate byte position within the underlying stream.

Declaration
public long Position { get; }
Property Value
Type Description
long

Methods

View Source

Dispose()

Processes the dispose data.

Declaration
public void Dispose()
View Source

ReadLine()

Reads a single (possibly unfolded) line from the stream. Returns null at EOF. The line terminator (CRLF, LF, or CR) is not included in the result.

Declaration
public string? ReadLine()
Returns
Type Description
string
View Source

ReadLineBytes()

Reads a single raw line as bytes from the stream, without unfolding. Returns null at EOF. The line terminator is not included.

Declaration
public byte[]? ReadLineBytes()
Returns
Type Description
byte[]
View Source

ReadLines()

Reads all remaining lines from the stream.

Declaration
public IReadOnlyList<string> ReadLines()
Returns
Type Description
IReadOnlyList<string>

Implements

IDisposable
  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX