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

public Class DefaultChannelStreamWriter

extends Object
implements ChannelStreamWriter
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.channel.throttle.ChannelStreamWriter, java.nio.channels.Channel, java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.IOException, org.apache.sshd.common.channel.Channel, org.apache.sshd.common.io.IoWriteFuture, org.apache.sshd.common.util.buffer.Buffer

A ChannelStreamWriter that simply calls the Channel#writePacket(Buffer) method.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
protected final Channel
protected volatile boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.nio.channels.Channel.close.

Closes this channel.

public boolean
isOpen()

Implements java.nio.channels.Channel.isOpen.

Tells whether or not this channel is open.

public IoWriteFuture
writeData(Buffer
the buffer to encode and send

Note

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

buffer
)

Implements org.apache.sshd.common.channel.throttle.ChannelStreamWriter.writeData.

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.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

channelback to summary
protected final Channel channel
closedback to summary
protected volatile boolean closed

Constructor Detail

DefaultChannelStreamWriterback to summary
public DefaultChannelStreamWriter(Channel channel)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.nio.channels.Channel.close.

Doc from java.nio.channels.Channel.close.

Closes this channel.

After a channel is closed, any further attempt to invoke I/O operations upon it will cause a ClosedChannelException to be thrown.

If this channel is already closed then invoking this method has no effect.

This method may be invoked at any time. If some other thread has already invoked it, however, then another invocation will block until the first invocation is complete, after which it will return without effect.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
isOpenback to summary
public boolean isOpen()

Implements java.nio.channels.Channel.isOpen.

Doc from java.nio.channels.Channel.isOpen.

Tells whether or not this channel is open.

Returns:boolean

true if, and only if, this channel is open

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

Implements org.apache.sshd.common.channel.throttle.ChannelStreamWriter.writeData.

Doc from org.apache.sshd.common.channel.throttle.ChannelStreamWriter.writeData.

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

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