Constructors: NewStreamWriter

NewStreamWriter

Creates a new StreamWriter with either a filename or other stream as a source to write to in the specified Encoding.



 Public Function NewStreamWriter(
	  ByVal Source As Variant,
	  Optional ByVal Encoding As Encoding,
	  Optional ByVal BufferSize As Long = 4096,
	  Optional ByVal Append As Boolean = False ) As StreamWriter

Parameters

Source
[ByVal] Variant. Either a FileName or Stream object to write to.
Encoding
[ByVal] Optional. Encoding. The encoding to be used when writing to the stream.
BufferSize
[ByVal] Optional. Long. The minimum size of the internal buffer used to cache writes.  

Default: 4096

Append
[ByVal] Optional. Boolean. Indicates if a file is to be appended to or overwritten.  

Default: False

Return Values

StreamWriter -  A new StreamWriter ready to write to an underlying stream in the specified Encoding.

Remarks

If a FileName is passed in, then a FileStream is created internally Using either FileMode.Create or FileMode.Append depending on Append, FileAccess.WriteAccess, FileShare.ReadShare.

If Encoding is not supplied, then an encoding of Cor.NewUTF8Encoding(False, True) is used.

See Also

Project VBCorLib Overview Class Constructors Overview Constructors Properties Constructors Methods NewStreamReader NewStringBuilder