public class BufferedIoOutputStream extends AbstractInnerCloseable implements IoOutputStream
IoOutputStream capable of queuing write requests.AbstractCloseable.State| Modifier and Type | Field and Description |
|---|---|
protected int |
channelId |
protected AtomicReference<IoWriteFutureImpl> |
currentWrite |
protected Object |
id |
protected int |
maxPendingBytesCount |
protected Duration |
maxWaitForPendingWrites |
protected IoOutputStream |
out |
protected AtomicInteger |
pendingBytesCount |
protected AtomicReference<SshChannelBufferedOutputException> |
pendingException |
protected Queue<IoWriteFutureImpl> |
writes |
protected AtomicLong |
writtenBytesCount |
closeFuture, futureLock, statelog| Constructor and Description |
|---|
BufferedIoOutputStream(Object id,
int channelId,
IoOutputStream out,
int maxPendingBytesCount,
Duration maxWaitForPendingWrites) |
BufferedIoOutputStream(Object id,
int channelId,
IoOutputStream out,
PropertyResolver resolver) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
finishWrite(IoWriteFutureImpl future,
int bufferSize) |
Object |
getId() |
protected Closeable |
getInnerCloseable() |
protected void |
startWriting() |
String |
toString() |
protected void |
waitForAvailableWriteSpace(int requiredSize) |
IoWriteFuture |
writeBuffer(Buffer buffer) |
doCloseGracefully, doCloseImmediatelyaddCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListenerdebug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenerprotected final Object id
protected final int channelId
protected final int maxPendingBytesCount
protected final Duration maxWaitForPendingWrites
protected final IoOutputStream out
protected final AtomicInteger pendingBytesCount
protected final AtomicLong writtenBytesCount
protected final Queue<IoWriteFutureImpl> writes
protected final AtomicReference<IoWriteFutureImpl> currentWrite
protected final AtomicReference<SshChannelBufferedOutputException> pendingException
public BufferedIoOutputStream(Object id, int channelId, IoOutputStream out, PropertyResolver resolver)
public BufferedIoOutputStream(Object id, int channelId, IoOutputStream out, int maxPendingBytesCount, Duration maxWaitForPendingWrites)
public Object getId()
public IoWriteFuture writeBuffer(Buffer buffer) throws IOException
writeBuffer in interface IoOutputStreamIOExceptionprotected void waitForAvailableWriteSpace(int requiredSize)
throws IOException
IOExceptionprotected void startWriting()
throws IOException
IOExceptionprotected void finishWrite(IoWriteFutureImpl future, int bufferSize)
protected Closeable getInnerCloseable()
getInnerCloseable in class AbstractInnerCloseableCopyright © 2008–2021 The Apache Software Foundation. All rights reserved.