Class: CSVStream

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

Constructor

Initialize a CSVStream using a io:ReadableTextRecordChannel.

init (ReadableTextRecordChannel readableTextRecordChannel)

Methods

next

The next function reads and return the next CSV record 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 CSV record of the related stream.

Return Type

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

Returns a CSV record as a string array when a record 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 csvStream.next() will automatically close the stream.

Return Type

(Error?)

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