StreamTerminalWriter
ConsoleMonster.Output
Writes text to a stream, typically redirected standard output, in UTF-8 (without BOM) unless another encoding is given. Text is buffered until StreamTerminalWriter.Flush so a frame or block reaches the device in one write.
Inheritance
- object
- StreamTerminalWriter
Usage
Explore 1 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
Constructors
public StreamTerminalWriter(Stream stream, bool ownsStream = false) #Creates a writer over a stream.
Parameters
- stream System.IO.Stream
- The stream.
- ownsStream bool = false
- Whether disposing the writer disposes the stream.
public StreamTerminalWriter(Stream stream, Encoding encoding, bool ownsStream = false) #Creates a writer over a stream that writes in encoding, without its preamble.
Parameters
- stream System.IO.Stream
- The stream.
- encoding System.Text.Encoding
- The encoding.
- ownsStream bool = false
- Whether disposing the writer disposes the stream.
Methods
public void Dispose() #Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public static StreamTerminalWriter ForStandardOutput() #Creates a writer over the process's real standard output (not Console.Out). On Windows it writes in the console code page, which is how a process that captures this one decodes it; CI logs and other platforms get UTF-8.
public void Write(string text) #Writes text. Implementations may buffer until ITerminalWriter.Flush.
Parameters
- text string
- Text, possibly containing VT sequences.
Inherited Methods
Properties
public bool IsConsole { get; } #Whether this writer targets a real console handle (as opposed to a file, pipe or buffer).