Object -
io
:
WritableCharacterChannel
Represents a channel which could be used to write characters through a given WritableCharacterChannel.
Constructor
__init
(WritableByteChannel bChannel, string charset)
- bChannel WritableByteChannel
-
The
WritableByteChannel
, which would be used to write the characters
- charset string
-
The character set, which would be used to encode the given bytes to characters
Methods
Writes a given sequence of characters (string).
int|io:Error result = writableCharChannel.write("Content", 0);
Parameters
- content string
-
Content, which should be written
- startOffset int
-
Number of characters, which should be offset when writing the content
-
Return Type
(int | Error) Content length that written or else
io:Error
Writes a given JSON to the given channel.
io:Error? err = writableCharChannel.writeJson(inputJson, 0);
Parameters
- content json
-
The JSON, which should be written
-
Return Type
(Error?) If an
io:Error
occurred while writing
Writes a given XML to the channel.
io:Error? err = writableCharChannel.writeXml(inputXml, 0);
Parameters
- content xml
-
The XML, which should be written
-
Return Type
(Error?) ()
or elseio:Error
if any error occurred