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

API Browser

Method

ReadLine

func ReadLine(maxUtf8Bytes: int) -> Task<Result<Optional<string>, TextReadError>>

Declaring type: StreamReader
Module: System.IO
Assembly: System.Runtime.dll
Source file: StreamReader.rvn

Implements TextReader.ReadLine

Returns a Task; await completion. Reads a decoded line without its LF or CRLF terminator.

Parameters

Name Type Description
maxUtf8Bytes Int32 Maximum content bytes, 0 through 65536 for StreamReader.

Return value

Task<Result<Optional<String>, TextReadError>>

The completed task contains: Some text for a line; None for EOF before any data; or TextReadError.

Remarks

StreamReader performs one-byte reads to avoid read-ahead. A lone CR is data. A BOM is preserved. An unterminated final line is returned once. Invalid bounds consume nothing; decoding, I/O and length errors may advance input. Close is checked first. No rollback is promised. Concurrent reads return Busy. Character reads may retain lookahead shared with line and whole-text reads.