Class: LineStream

The io:LineStream is used to initialize a stream of the type strings(lines). This io:LineStream refers to the stream that is embedded to the I/O character channels.

Constructor

Initialize an io:LineStream using an io:ReadableCharacterChannel.

init (ReadableCharacterChannel readableCharacterChannel)

Methods

next

The next function reads and returns the next line of the related stream.

close

Closes the stream.

function next() returns record {| string value; |} | Error?
Isolated Function

The next function reads and returns the next line of the related stream.

Return Type

(record {| string value; |} | Error?)

A line as a string when a line is avaliable in the stream or returns () when the stream reaches the end

close

function close() returns Error?
Isolated Function

Closes the stream. The primary usage of this function is to close the stream without reaching the end If the stream reaches the end, the lineStream.next() will automatically close the stream.

Return Type

(Error?)

() when the closing was successful or an io:Error