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 an error

readXml

()

returns xml | error | ()

Reads string as XML from reader

readChar

(int nCharacters)

returns string | error | ()

Reads characters from the given string.

Parameters

  • nCharacters int
  • read specific number of characters

close

()

returns error?

Closes reader.

  • Return Type

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