Package org.apache.sshd.common.channel
Class SimpleIoOutputStream
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.util.closeable.IoBaseCloseable
-
- org.apache.sshd.common.util.closeable.AbstractCloseable
-
- org.apache.sshd.common.channel.SimpleIoOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.nio.channels.Channel
,Closeable
,IoOutputStream
public class SimpleIoOutputStream extends AbstractCloseable implements IoOutputStream
An implementation ofIoOutputStream
using a synchronousChannelOutputStream
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SimpleIoOutputStream.DefaultIoWriteFuture
-
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
-
-
Field Summary
Fields Modifier and Type Field Description protected ChannelOutputStream
os
-
Fields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, state
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description SimpleIoOutputStream(ChannelOutputStream os)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doCloseImmediately()
doCloseImmediately is called once and only once with state == ImmediateIoWriteFuture
writeBuffer(Buffer buffer)
Write the given buffer.-
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, doCloseGracefully, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListener
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
-
-
-
-
Field Detail
-
os
protected final ChannelOutputStream os
-
-
Constructor Detail
-
SimpleIoOutputStream
public SimpleIoOutputStream(ChannelOutputStream os)
-
-
Method Detail
-
doCloseImmediately
protected void doCloseImmediately()
Description copied from class:AbstractCloseable
doCloseImmediately is called once and only once with state == Immediate
Overriding methods should always call the base implementation. It may be called concurrently while preClose() or doCloseGracefully is executing
- Overrides:
doCloseImmediately
in classAbstractCloseable
-
writeBuffer
public IoWriteFuture writeBuffer(Buffer buffer) throws java.io.IOException
Description copied from interface:IoOutputStream
Write the given buffer.- Specified by:
writeBuffer
in interfaceIoOutputStream
- Parameters:
buffer
- the data to write. NOTE: the buffer must not be touched until the returned write future is completed.- Returns:
- An
IoWriteFuture
that can be used to check when the data has actually been written. - Throws:
java.io.IOException
- if an error occurred when writing the data
-
-