readUTF8Line

suspend fun ByteReadChannel.readUTF8Line(max: Int = Int.MAX_VALUE): String?

Reads a line of UTF-8 characters from the ByteReadChannel. It recognizes CR, LF and CRLF as line delimiters.

Return

a string containing the line read, or null if channel is closed

Parameters

max

the maximum number of characters to read. Default is Int.MAX_VALUE.

Throws

if max is reached before encountering a newline or end of input