Object - io : ReadableCharacterChannel

Represents a channel which could be used to read characters through a given ReadableByteChannel.

read

(int numberOfChars)

returns string | Error

Reads a given number of characters. This will attempt read up to numberOfChars characters from the channel. io:EofError will return once channel reach to it end.

Parameters

  • numberOfChars int
  • Number of characters which should be read

  • Return Type

    (string | Error)
  • Content which is read or EofError once channel reach to it end. Error if any error occurred.

readJson

()

returns json | Error

Reads a json from the given channel.

  • Return Type

    (json | Error)
  • Read json string or Error if any error occurred

readXml

()

returns xml | Error

Reads a XML from the given channel.

  • Return Type

    (xml | Error)
  • Read xml or Error if any error occurred

close

()

returns Error?

Closes a given character channel.

  • Return Type

    (Error?)
  • If an error occurred while writing