public LineWrappingTextWriter(
TextWriter baseWriter,
int maximumLineLength,
bool disposeBaseWriter = true,
bool countFormatting = false
)
Public Sub New (
baseWriter As TextWriter,
maximumLineLength As Integer,
Optional disposeBaseWriter As Boolean = true,
Optional countFormatting As Boolean = false
)
Dim baseWriter As TextWriter
Dim maximumLineLength As Integer
Dim disposeBaseWriter As Boolean
Dim countFormatting As Boolean
Dim instance As New LineWrappingTextWriter(baseWriter,
maximumLineLength, disposeBaseWriter,
countFormatting)
public:
LineWrappingTextWriter(
TextWriter^ baseWriter,
int maximumLineLength,
bool disposeBaseWriter = true,
bool countFormatting = false
)
The largest maximumLineLength value supported is 65535. Above that, line length is considered to be unbounded. This is done to avoid having to buffer large amounts of data to support these long line lengths.
If you want to write to the console, use ConsoleOut or ConsoleError as the baseWriter and specify ConsoleWindowWidth - 1 as the maximumLineLength and for disposeBaseWriter. If you don't subtract one from the window width, additional empty lines can be printed if a line is exactly the width of the console. You can easily create a LineWrappingTextWriter that writes to the console by using the ForConsoleOut and ForConsoleError methods.
ArgumentNullException | baseWriter is . |