Object - io : WritableCharacterChannel

Represents a channel which could be used to write characters through a given WritableCharacterChannel.

Constructor

__init

(WritableByteChannel bChannel, string charset)

  • charset string
  • Character-Set which would be used to encode given bytes to characters

Methods

write

(string content, int startOffset)

returns int | Error

Writes a given sequence of characters (string).

Parameters

  • content string
  • Content which should be written

  • startOffset int
  • Number of characters which should be offset when writing content

  • Return Type

    (int | Error)
  • Content length that written or Error if any error occurred

writeJson

(json content)

returns Error?

Writes a given json to the given channel.

Parameters

  • content json
  • The json which should be written

  • Return Type

    (Error?)
  • If an Error occurred while writing

writeXml

(xml content)

returns Error?

Writes a given xml to the channel.

Parameters

  • content xml
  • The XML which should be written

  • Return Type

    (Error?)
  • Nil or Error if any error occurred

close

()

returns Error?

Closes a given WritableCharacterChannel channel.

  • Return Type

    (Error?)
  • Nil or Error if any error occurred