Class TextDataWriter
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
StreamStream 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
TextDataWriter(Stream, Encoding)
Initializes a new instance of the TextDataWriter class.
public TextDataWriter(Stream stream, Encoding encoding)
Parameters
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
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
Methods
Write(char)
Write the specified char.
public void Write(char ch)
Parameters
ch
charChar 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
stringText to write.
Write(string, params object[])
Write the specified text with format.
public void Write(string format, params object[] args)
Parameters
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
stringText to write.
WriteLine(string, params object[])
Writes the specified text with format.
public void WriteLine(string format, params object[] args)
Parameters
WritePreamble()
Write the encoding preamble.
public void WritePreamble()