Table of Contents

Class TextDataWriter

Namespace
Yarhl.IO
Assembly
Yarhl.dll

Text writer for Stream.

public class TextDataWriter
Inheritance
TextDataWriter
Inherited Members

Constructors

TextDataWriter(Stream)

Initializes a new instance of the TextDataWriter class.

public TextDataWriter(Stream stream)

Parameters

stream Stream

Stream to write to.

Remarks

The default encoding is UTF-8.

TextDataWriter(Stream, string)

Initializes a new instance of the TextDataWriter class.

public TextDataWriter(Stream stream, string encoding)

Parameters

stream Stream

Stream to read from.

encoding string

Encoding to use.

TextDataWriter(Stream, Encoding)

Initializes a new instance of the TextDataWriter class.

public TextDataWriter(Stream stream, Encoding encoding)

Parameters

stream Stream

Stream to write to.

encoding Encoding

Encoding to use.

Properties

AutoPreamble

Gets or sets a value indicating whether write automatically the encoding preamble.

public bool AutoPreamble { get; set; }

Property Value

bool

True to write the preamble if the stream is empty, otherwise false.

Encoding

Gets the encoding.

public Encoding Encoding { get; }

Property Value

Encoding

NewLine

Gets or sets the new line character.

public string NewLine { get; set; }

Property Value

string

The new line character.

Remarks

The default value is \n, the Unix new line.

Stream

Gets the stream.

public DataStream Stream { get; }

Property Value

DataStream

Methods

Write(char)

Write the specified char.

public void Write(char ch)

Parameters

ch char

Char to write.

Write(char[])

Write the specified chars.

public void Write(char[] chars)

Parameters

chars char[]

Chars to write.

Write(string)

Write the specified text without including a new line.

public void Write(string text)

Parameters

text string

Text to write.

Write(string, params object[])

Write the specified text with format.

public void Write(string format, params object[] args)

Parameters

format string

Format for the text.

args object[]

Arguments for the format.

WriteLine()

Writes a new line.

public void WriteLine()

WriteLine(string)

Writes the specified text and add a new line.

public void WriteLine(string text)

Parameters

text string

Text to write.

WriteLine(string, params object[])

Writes the specified text with format.

public void WriteLine(string format, params object[] args)

Parameters

format string

Format for the text.

args object[]

Arguments of the format.

WritePreamble()

Write the encoding preamble.

public void WritePreamble()