Object - io : ReadableTextRecordChannel

Represents a channel which will allow to read

Constructor

__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)

  • fmt string default

Methods

Checks whether there's a record left to be read.
Get the next record from the input/output resource.
Closes a given record channel.

hasNext

()

returns boolean

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

 boolean hasNext = readableRecChannel.hasNext();

  • Return Type

    (boolean)
  • True if there's a record left to be read

getNext

()

returns string[] | Error

Get the next record from the input/output resource.

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

  • Return Type

    (string[] | Error)
  • Set of fields included in the record or else io:Error

close

()

returns Error?

Closes a given record channel.

 io:Error err = readableRecChannel.close();

  • Return Type

    (Error?)
  • An io:Error if the record channel could not be closed properly