public class CharacterChannel extends Object
Represents the channel to perform character I/O operations.
This is a stateful channel.
Constructor and Description |
---|
CharacterChannel(AbstractChannel channel,
String encoding) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the given channel.
|
String |
read(int numberOfCharacters)
Reads specified number of characters from a given channel.
|
String |
readAll()
Reads all content from the I/O source.
|
int |
write(String content,
int offset)
Writes a given string input into the channel.
|
public CharacterChannel(AbstractChannel channel, String encoding)
public String read(int numberOfCharacters) throws BallerinaIOException
numberOfCharacters
- the number of characters which should be retrieved.BallerinaIOException
- I/O errors.public String readAll()
public int write(String content, int offset) throws BallerinaIOException
content
- the string content to be written.offset
- the offset which should be used for writing.BallerinaIOException
- during I/O error.public void close()
Copyright © 2018 WSO2. All rights reserved.