Class: ReadableTextRecordChannel

Represents a channel which will allow to read.

Constructor

Constructs a ReadableTextRecordChannel from a given ReadableCharacterChannel.

init (ReadableCharacterChannel charChannel, string fs, string rs, string fmt)
  • fs string ""
  • Field separator (this could be a regex)

  • rs string ""
  • Record separator (this could be a regex)

Methods

hasNext

Checks whether there's a record left to be read.

getNext

Get the next record from the input/output resource.

close

Closes a given record channel.

hasNext

function hasNext() returns boolean
Isolated Function

Checks whether there's a record left to be read.

1boolean hasNext = readableRecChannel.hasNext();

Return Type

(boolean)

True if there's a record left to be read

getNext

function getNext() returns string[ ] | Error
Isolated Function

Get the next record from the input/output resource.

1string[]|io:Error record = readableRecChannel.getNext();

Return Type

(string[ ] | Error)

Set of fields included in the record or else io:Error

close

function close() returns Error?
Isolated Function

Closes a given record channel. After a channel is closed, any further reading operations will cause an error.

1io:Error err = readableRecChannel.close();

Return Type

(Error?)

An io:Error if the record channel could not be closed properly