Class BufferedIoOutputStream
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.util.closeable.AbstractInnerCloseable
org.apache.sshd.common.channel.BufferedIoOutputStream
- All Implemented Interfaces:
Closeable, AutoCloseable, Channel, ChannelIdentifier, org.apache.sshd.common.Closeable, org.apache.sshd.common.io.IoOutputStream
public class BufferedIoOutputStream
extends org.apache.sshd.common.util.closeable.AbstractInnerCloseable
implements org.apache.sshd.common.io.IoOutputStream, ChannelIdentifier
An
IoOutputStream capable of queuing write requests.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
org.apache.sshd.common.util.closeable.AbstractCloseable.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final longprotected final AtomicReference<IoWriteFutureImpl> protected final Objectprotected final intprotected final Durationprotected final org.apache.sshd.common.io.IoOutputStreamprotected final AtomicIntegerprotected final AtomicReference<SshChannelBufferedOutputException> protected final Queue<IoWriteFutureImpl> protected final AtomicLongFields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, stateFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log -
Constructor Summary
ConstructorsConstructorDescriptionBufferedIoOutputStream(Object id, long channelId, org.apache.sshd.common.io.IoOutputStream out, int maxPendingBytesCount, Duration maxWaitForPendingWrites) BufferedIoOutputStream(Object id, long channelId, org.apache.sshd.common.io.IoOutputStream out, org.apache.sshd.common.PropertyResolver resolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinishWrite(IoWriteFutureImpl future, int bufferSize) longgetId()protected org.apache.sshd.common.Closeableprotected voidtoString()protected voidwaitForAvailableWriteSpace(int requiredSize) org.apache.sshd.common.io.IoWriteFuturewriteBuffer(org.apache.sshd.common.util.buffer.Buffer buffer) Methods inherited from class org.apache.sshd.common.util.closeable.AbstractInnerCloseable
doCloseGracefully, doCloseImmediatelyMethods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListenerMethods 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, warnMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
-
Field Details
-
id
-
channelId
protected final long channelId -
maxPendingBytesCount
protected final int maxPendingBytesCount -
maxWaitForPendingWrites
-
out
protected final org.apache.sshd.common.io.IoOutputStream out -
pendingBytesCount
-
writtenBytesCount
-
writes
-
currentWrite
-
pendingException
-
-
Constructor Details
-
BufferedIoOutputStream
public BufferedIoOutputStream(Object id, long channelId, org.apache.sshd.common.io.IoOutputStream out, org.apache.sshd.common.PropertyResolver resolver) -
BufferedIoOutputStream
-
-
Method Details
-
getChannelId
public long getChannelId()- Specified by:
getChannelIdin interfaceChannelIdentifier- Returns:
- Local channel UINT32 identifier
-
getId
-
writeBuffer
public org.apache.sshd.common.io.IoWriteFuture writeBuffer(org.apache.sshd.common.util.buffer.Buffer buffer) throws IOException - Specified by:
writeBufferin interfaceorg.apache.sshd.common.io.IoOutputStream- Throws:
IOException
-
waitForAvailableWriteSpace
- Throws:
IOException
-
startWriting
- Throws:
IOException
-
finishWrite
-
getInnerCloseable
protected org.apache.sshd.common.Closeable getInnerCloseable()- Specified by:
getInnerCloseablein classorg.apache.sshd.common.util.closeable.AbstractInnerCloseable
-
toString
-