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

    Fields
    Modifier and Type
    Field
    Description
    protected final long
     
     
    protected final Object
     
    protected final int
     
    protected final Duration
     
    protected final org.apache.sshd.common.io.IoOutputStream
     
    protected final AtomicInteger
     
     
    protected final Queue<IoWriteFutureImpl>
     
    protected final AtomicLong
     

    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
    BufferedIoOutputStream(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 Type
    Method
    Description
    protected void
    finishWrite(IoWriteFutureImpl future, int bufferSize)
     
    long
     
     
    protected org.apache.sshd.common.Closeable
     
    protected void
     
     
    protected void
    waitForAvailableWriteSpace(int requiredSize)
     
    org.apache.sshd.common.io.IoWriteFuture
    writeBuffer(org.apache.sshd.common.util.buffer.Buffer buffer)
     

    Methods inherited from class org.apache.sshd.common.util.closeable.AbstractInnerCloseable

    doCloseGracefully, doCloseImmediately

    Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable

    addCloseFutureListener, builder, close, 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 Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.sshd.common.Closeable

    addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
  • Field Details

  • Constructor Details

    • BufferedIoOutputStream

      public BufferedIoOutputStream(Object id, long channelId, org.apache.sshd.common.io.IoOutputStream out, org.apache.sshd.common.PropertyResolver resolver)
    • BufferedIoOutputStream

      public BufferedIoOutputStream(Object id, long channelId, org.apache.sshd.common.io.IoOutputStream out, int maxPendingBytesCount, Duration maxWaitForPendingWrites)
  • Method Details

    • getChannelId

      public long getChannelId()
      Specified by:
      getChannelId in interface ChannelIdentifier
      Returns:
      Local channel UINT32 identifier
    • getId

      public Object getId()
    • writeBuffer

      public org.apache.sshd.common.io.IoWriteFuture writeBuffer(org.apache.sshd.common.util.buffer.Buffer buffer) throws IOException
      Specified by:
      writeBuffer in interface org.apache.sshd.common.io.IoOutputStream
      Throws:
      IOException
    • waitForAvailableWriteSpace

      protected void waitForAvailableWriteSpace(int requiredSize) throws IOException
      Throws:
      IOException
    • startWriting

      protected void startWriting() throws IOException
      Throws:
      IOException
    • finishWrite

      protected void finishWrite(IoWriteFutureImpl future, int bufferSize)
    • getInnerCloseable

      protected org.apache.sshd.common.Closeable getInnerCloseable()
      Specified by:
      getInnerCloseable in class org.apache.sshd.common.util.closeable.AbstractInnerCloseable
    • toString

      public String toString()
      Overrides:
      toString in class Object