public abstract class AbstractChannel extends Object
Represents the channel which allows reading/writing bytes to I/O devices.
Any channel implementation could inherit it's base methods from this.
Note : this channel does not support concurrent reading/writing, hence this should not be accessed concurrently.
Channel
,
CharacterChannel
,
TextRecordChannel
Constructor and Description |
---|
AbstractChannel(ByteChannel channel)
Creates a ballerina channel which will source/sink from I/O resource.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the given channel.
|
abstract void |
transfer(int position,
int count,
WritableByteChannel dstChannel)
Will be used when performing direct transfer operations from OS cache.
|
public AbstractChannel(ByteChannel channel) throws BallerinaIOException
channel
- the channel to source/sink bytes.BallerinaIOException
public abstract void transfer(int position, int count, WritableByteChannel dstChannel) throws BallerinaIOException
position
- starting position of the bytes to be transferred.count
- number of bytes to be transferred.dstChannel
- destination channel to transfer.BallerinaIOException
- during I/O error.public void close()
Copyright © 2018 WSO2. All rights reserved.