Class: CSVStream

The io:CSVStream is used to initialize a stream of type CSV records. This io:CSVStream refers to the stream that is embedded to the I/O record channels.

Constructor

Initialize a CSVStream using an io:ReadableTextRecordChannel.

init (ReadableTextRecordChannel readableTextRecordChannel)

Methods

next

The next function reads and returns the next CSV record of the related stream.

close

Close the stream.

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

The next function reads and returns the next CSV record of the related stream.

Return Type

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

A CSV record as a string array when a record is avaliable in the stream or () 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?)

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