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)
- readableCharacterChannel ReadableCharacterChannel
The
io:ReadableCharacterChannel
that this line stream is referred to
Methods
next
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.