readLineTo

suspend fun ByteReadChannel.readLineTo(out: Appendable, lineEnding: LineEnding = LineEnding.Default): Long(source)

Reads a line of UTF-8 characters to the specified out buffer.

Appends UTF-8 characters until a line break is found or the channel is exhausted. Implicit line break is assumed if the channel ends without a line break. Line break characters are not included in the result.

Report a problem

Return

number of characters appended to out, or -1 if can't read from the channel

Parameters

out

the buffer to append line to (line break characters are not appended)

lineEnding

line ending mode. Accepts LF and CRLF by default.