StreamWriter

StreamWriter


Writes characters to a byte stream using the specific encoding.


Implements:

IObject 
TextWriter 

Public:

Properties:

NameDescription
 AutoFlush (get) Returns if the writer autoflushes after each write.  
 AutoFlush (let) Sets if the writer autoflushes after each write.  
 BaseStream (get) Returns the stream this writer is using.  
 Encoding (get) Returns the encoding being used by this writer.  
 FormatProvider (get) Returns the format provider being used by this writer.  
 NewLine (get) Returns the new-line string used by this writer.  
 NewLine (let) Sets the new-line string used by this writer.  

Methods:

NameDescription
 CloseWriter Closes this writer, flushing any buffers needed.  
 Equals Returns a boolean indicating if the value and this object instance are the same instance.  
 Flush Flushes the buffers to the underlying stream.  
 GetHashCode Returns a pseudo-unique number identifying this instance.  
 ToString Returns a string representation of this object instance.  
 WriteChars Writes a subarray of characters to the stream.  
 WriteLine Writes the value, then appends the new-line string.  
 WriteLineChars Writes a subarray of characters to the text stream, followed by a line terminator.  
 WriteValue Writes the encoded string representation of the value to the stream.  

Remarks

StreamWriter defaults to using an instance of UTF8Encoding unless specified otherwise. This instance of UTF8Encoding is constructed without a byte order mark (BOM), so its GetPreamble method returns an empty byte array. To create a StreamWriter using UTF-8 encoding and a BOM, consider using a constructor that specifies encoding, such as NewStreamWriter(String, Boolean, Encoding).

See Also

Project CorLib Overview

Class StreamWriter Overview