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 to read up to numberOfChars characters of the channel. io:EofError will return once the channel reaches the end.

Parameters

  • numberOfChars int
  • Number of characters, which should be read

  • Return Type

    (string | Error)
  • Content, which is read or EofError once channel reaches the end. Error if any error occurred.

readJson

()

returns json | Error

Reads a JSON from the given channel.

  • Return Type

    (json | Error)
  • the read JSON string or Error if any error occurred

readXml

()

returns xml | Error

Reads an XML from the given channel.

  • Return Type

    (xml | Error)
  • The 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