Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

StreamWriter

class StreamWriter

Module: System.IO
Assembly: System.Runtime.dll
Source file: StreamWriter.rvn

Inheritance: Object → StreamWriter
Implements: TextWriter

Asynchronous buffered text output with explicit stream ownership.

Properties

1 item
NewLine: string String appended by WriteLine. Defaults to LF; an empty string appends nothing. Implements TextWriter.NewLine

Methods

11 items
Close() -> () Closes this wrapper and its output unless leaveOpen was selected. Does not flush or finish. Implements TextWriter.Close
Static member: Create(output: OutputStream, encoding: Encoding, leaveOpen?: bool) -> Result<StreamWriter, StreamError> Creates a wrapper with the supplied encoding and ownership policy.
Static member: Create(output: OutputStream, leaveOpen?: bool) -> Result<StreamWriter, StreamError> Creates a UTF-8 wrapper with explicit ownership of the underlying stream.
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
Finish() -> Task<Result<int, StreamError>> Finalizes encoding. Repeated successful finalization returns zero. Implements TextWriter.Finish
Flush() -> Task<Result<void, StreamError>> Flushes the underlying output without finalizing the encoder. Implements TextWriter.Flush
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString
Write(text: string) -> Task<Result<int, StreamError>> Encodes and writes text; returns the number of encoded bytes. Implements TextWriter.Write
WriteLine(text: string) -> Task<Result<int, StreamError>> Encodes and writes text followed by NewLine; returns the encoded byte count. Implements TextWriter.WriteLine