Buffered Writer¶
Import: import system.io;
BufferedWriter¶
Buffers output to a borrowed writer without closing it. Call finish() explicitly to report flush failures; destruction does not flush pending bytes.
constructor¶
Wraps destination with an 8 KiB default buffer; nonpositive sizes fail on use.
write¶
Accepts as many bytes as fit, flushing a previously full buffer first. May return partial progress; operations after successful finish return ECLOSED.
flush¶
Writes pending bytes and flushes the destination; retains any unwritten suffix on failure. Already completed writes persist, and a finished writer returns ECLOSED.
finish¶
Flushes and marks the wrapper finished only on success; repeated success is idempotent. Leaves the underlying writer open and permits retry after a flush failure.