StreamExtensions.

GetWriter(Stream, bool) Method

Summary

Creates a System.IO.StreamWriter for the specified stream. The biggest difference between this and creating a System.IO.StreamWriter directly is that the new System.IO.StreamWriter will default to leaving the underlying stream open on disposal. Remember to flush the returned writer after all data have been written.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Util
Containing Type
StreamExtensions

Syntax

public static StreamWriter GetWriter(this Stream stream, bool leaveOpen = true)

Parameters

Name Type Description
stream Stream The stream to write to.
leaveOpen bool true to leave the underlying stream open on disposal.

Return Value

Type Description
StreamWriter A new System.IO.StreamWriter for the specified stream.
GitHub