Object - io : StringReader

Represents a reader which will wrap string content as a channel.

Constructor

__init

(string content, string encoding)

  • content string
  • content which should be written

  • encoding string UTF-8
  • encoding of the characters of the content

Methods

readJson

()

returns json | Error

Reads string as json from reader.

  • Return Type

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

readXml

()

returns xml | Error | ()

Reads string as XML from reader

  • Return Type

    (xml | Error | ())

readChar

(int nCharacters)

returns string | Error | ()

Reads characters from the given string.

Parameters

  • nCharacters int
  • read specific number of characters

  • Return Type

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

close

()

returns Error?

Closes reader.

  • Return Type

    (Error?)
  • An Error if could not close the channel.