Object - io : ReadableCharacterChannel
Represents a channel, which could be used to read characters through a given ReadableByteChannel.
(ReadableByteChannel byteChannel, string charset)
- byteChannel ReadableByteChannel
ReadableByteChannel, which would be used to read the characters
- charset string
The character set, which would be used to encode/decode the given bytes to characters
(int numberOfChars)returns string | Error
Reads a given number of characters. This will attempt to read up to the
numberOfChars characters of the channel.
io:EofError will return once the channel reaches the end.
string|io:Error result = readableCharChannel.read(1000);
- numberOfChars int
Number of characters, which should be read
Return Type(string | Error)
Content, which is read, an
EofErroronce the channel reaches the end or else an
()returns json | Error
Reads a JSON from the given channel.
json|io:Error result = readableCharChannel.readJson();
Return Type(json | Error)
The read JSON string or else an
()returns xml | Error
Reads an XML from the given channel.
json|io:Error result = readableCharChannel.readXml();
Return Type(xml | Error)
The read XML or else an