Class: LineStream

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

Constructor

Initialize a LineStream using a io:ReadableCharacterChannel.

init (ReadableCharacterChannel readableCharacterChannel)

Methods

next

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

close

Close the stream.

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

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

Return Type

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

Returns a line as a string when a line is avaliable in the stream or return null when the stream reaches the end

close

function close() returns Error?
Isolated Function

Close 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?)

Returns null when the closing was successful or an io:Error