public class CharacterChannel extends Object
Represents the channel to perform character I/O operations.
This is a stateful channel.
Constructor and Description |
---|
CharacterChannel(Channel channel,
String encoding) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the given channel.
|
String |
read(int numberOfCharacters)
Read asynchronously from channel.
|
String |
readAll()
Deprecated.
|
int |
write(String content,
int offset)
Writes a given string input into the channel.
|
public String read(int numberOfCharacters) throws IOException
numberOfCharacters
- number of characters which needs to be read.IOException
- during I/O error.@Deprecated public String readAll() throws IOException
IOException
- during I/O error.public int write(String content, int offset) throws IOException
content
- the string content to be written.offset
- the offset which should be used for writing.IOException
- during I/O error.public void close() throws IOException
IOException
- errors occur while trying to close the connection.Copyright © 2018 WSO2. All rights reserved.