Class: WritableCharacterChannel
Represents a channel which could be used to write characters through a given WritableCharacterChannel.
Constructor
Constructs an io:WritableByteChannel
from a given io:WritableByteChannel
and Charset
.
init (WritableByteChannel bChannel, string charset)
- bChannel WritableByteChannel
The
io: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
write | Writes a given sequence of characters (string). |
writeLine | Writes a string as a line with a following newline character |
writeJson | Writes a given JSON to the given channel. |
writeXml | Writes a given XML to the channel. |
writeProperties | Writes a given key-valued pair |
close | Closes the |
writeLine
Writes a string as a line with a following newline character \n
.
1io:Error? result = writableCharChannel.writeLine("Content");
Parameters
- content string
Content to be written
writeXml
function writeXml(xml content, XmlDoctype? xmlDoctype) returns Error?
Writes a given XML to the channel.
1io:Error? err = writableCharChannel.writeXml(inputXml, 0);
Parameters
- content xml
The XML to be written
- xmlDoctype XmlDoctype? (default ())
Optional argument to specify the XML DOCTYPE configurations
writeProperties
Writes a given key-valued pair map<string>
to a property file.
1io:Error? err = writableCharChannel.writeProperties(properties);
Parameters
- comment string
Comment describing the property list