class · System.IO

StreamWriter

public class System.IO.StreamWriter : System.IO.TextWriter

Text written to a stream as UTF-8, through a buffer.

Kind
class
Namespace
System.IO
Assembly
System.Core
Access
public
Source file
TextIO.ant

Inheritance

Base classes
Any TextWriter StreamWriter

Constructors

constructor StreamWriter(stream: System.IO.Stream)
#
constructor StreamWriter(stream: System.IO.Stream, bufferSize: i32)
#
constructor StreamWriter(path: System.String<u8>)
#

A new file (or the file emptied).

constructor StreamWriter(path: System.String<u8>, append: bool)
#

A file written from its end when append, else emptied first.

Properties

property AutoFlush: bool
#

Sends the text to the stream after every Write.

property BaseStream: System.IO.Stream
#

read-only

The stream it writes to.

Methods

method Write(text: System.String<u8>) -> void
#

override

method Write(c: u16) -> void
#

override

method Flush() -> void
#

override

method Close() -> void
#

override

Private and internal members (4)

field stream: System.IO.Stream
#

private

field buffer: u8[]
#

private

field used: i32
#

private

method Drain() -> void
#

private

Writes what is buffered (without flushing the stream).

Inherited members (42)

Source

StreamWriter as Larva HIR, decompiled from its Larva HIR.

System.IO.StreamWriter.hir
// Text written to a stream as UTF-8, through a buffer.
public class System.IO.StreamWriter : System.IO.TextWriter
{
    field stream: System.IO.Stream
    field buffer: u8[]
    field used: i32
    // Writes what is buffered (without flushing the stream).
    method Drain() -> void
    constructor StreamWriter(stream: System.IO.Stream)
    constructor StreamWriter(stream: System.IO.Stream, bufferSize: i32)
    // A new file (or the file emptied).
    constructor StreamWriter(path: System.String<u8>)
    // A file written from its end when `append`, else emptied first.
    constructor StreamWriter(path: System.String<u8>, append: bool)
    method Write(text: System.String<u8>) -> void
    method Write(c: u16) -> void
    method Flush() -> void
    method Close() -> void
    // Sends the text to the stream after every Write.
    property AutoFlush: bool
    // The stream it writes to.
    property BaseStream: System.IO.Stream
}
Esc