Streams¶
Import: import system.io;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
Streams¶
Copy helpers that leave ownership and closure of both streams with the caller.
read_text¶
Reads all remaining bytes and decodes them as UTF-8. Memory grows with the input.
copy¶
Copies to EOF using chunks bounded by positive buffer_size (default 8 KiB), then flushes the destination and returns the byte count; neither stream is closed.
public static fun copy(
source: Reader,
destination: Writer,
buffer_size: int = 8192
): Result<long, IoError>
copy_async¶
Copies to EOF with bounded chunks, partial-write retries, and cancellation checks, then flushes and returns the byte count. Neither stream is closed; completed writes persist.