Object -
io
:
ReadableCharacterChannel
Represents a channel, which could be used to read characters through a given ReadableByteChannel.
Constructor
__init
(ReadableByteChannel byteChannel, string charset)
- byteChannel ReadableByteChannel
-
ReadableByteChannel, which would be used to read the characters
- charset string
-
Character-Set which would be used to encode/decode the given bytes to characters
Methods
Reads a given number of characters. This will attempt to read up to numberOfChars
characters of the channel.
io:EofError
will return once the channel reaches the end.
Reads a JSON from the given channel.
Reads an XML from the given channel.
Closes a given character channel.
Reads a given number of characters. This will attempt to read up to numberOfChars
characters of the channel.
io:EofError
will return once the channel reaches the end.
Parameters
- numberOfChars int
-
Number of characters, which should be read
-
Return Type
(string | Error) Content, which is read or
EofError
once channel reaches the end.Error
if any error occurred.
Reads a JSON from the given channel.
-
Return Type
(json | Error) the read JSON string or
Error
if any error occurred
Reads an XML from the given channel.
-
Return Type
(xml | Error) The read XML or
Error
if any error occurred