Top Description Methods
org.apache.sshd.common.channel.throttle

public Interface ChannelStreamWriter

extends Channel
Known Direct Implementers
org.apache.sshd.common.channel.throttle.DefaultChannelStreamWriter
Imports
java.io.IOException, java.nio.channels.Channel, org.apache.sshd.common.io.IoWriteFuture, org.apache.sshd.common.util.buffer.Buffer

The ChannelStreamWriter is used when writing to the channel data stream. This data is encoded and sent with the org.apache.sshd.common.SshConstants#SSH_MSG_CHANNEL_DATA and org.apache.sshd.common.SshConstants#SSH_MSG_CHANNEL_EXTENDED_DATA commands.
Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public IoWriteFuture

Returns:

An IoWriteFuture that can be used to check when the packet has actually been sent
writeData
(Buffer
the buffer to encode and send

Note

the buffer must not be touched until the returned write future is completed.

buffer
)

Encode and send the given data packet buffer

Note

the buffer has to have 5 bytes free at the beginning to allow the encoding to take place.

Inherited from java.nio.channels.Channel:
closeisOpen

Method Detail

writeDataback to summary
public IoWriteFuture writeData(Buffer buffer) throws IOException

Encode and send the given data packet buffer

Note

the buffer has to have 5 bytes free at the beginning to allow the encoding to take place. Also, the write position of the buffer has to be set to the position of the last byte to write.

Parameters
buffer:Buffer

the buffer to encode and send

Note

the buffer must not be touched until the returned write future is completed.

Returns:IoWriteFuture

An IoWriteFuture that can be used to check when the packet has actually been sent

Exceptions
IOException:
if an error occurred when encoding or sending the packet