public class ChannelAsyncOutputStream extends AbstractCloseable implements IoOutputStream, ChannelHolder
AbstractCloseable.State
closeFuture, futureLock, state
log
Constructor and Description |
---|
ChannelAsyncOutputStream(Channel channel,
byte cmd) |
Modifier and Type | Method and Description |
---|---|
protected Buffer |
createSendBuffer(Buffer buffer,
Channel channel,
long length) |
protected CloseFuture |
doCloseGracefully() |
protected void |
doWriteIfPossible(boolean resume) |
Channel |
getChannel() |
void |
onWindowExpanded() |
protected void |
onWritten(IoWriteFutureImpl future,
int total,
long length,
IoWriteFuture f) |
protected void |
preClose()
preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.
|
String |
toString() |
IoWriteFuture |
writeBuffer(Buffer buffer)
Write the given buffer.
|
addCloseFutureListener, builder, close, doCloseImmediately, getFutureLock, isClosed, isClosing, removeCloseFutureListener
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
public ChannelAsyncOutputStream(Channel channel, byte cmd)
public Channel getChannel()
getChannel
in interface ChannelHolder
Channel
instancepublic void onWindowExpanded() throws IOException
IOException
public IoWriteFuture writeBuffer(Buffer buffer) throws IOException
IoOutputStream
writeBuffer
in interface IoOutputStream
buffer
- the data to write. NOTE: the buffer must not be touched until the returned write
future is completed.IoWriteFuture
that can be used to check when the data has actually been written.IOException
- if an error occurred when writing the dataprotected void preClose()
AbstractCloseable
preClose
in class AbstractCloseable
protected CloseFuture doCloseGracefully()
doCloseGracefully
in class AbstractCloseable
protected void doWriteIfPossible(boolean resume)
protected void onWritten(IoWriteFutureImpl future, int total, long length, IoWriteFuture f)
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.