public class SimpleIoOutputStream extends AbstractCloseable implements IoOutputStream
IoOutputStream
using a synchronous ChannelOutputStream
.Modifier and Type | Class and Description |
---|---|
protected static class |
SimpleIoOutputStream.DefaultIoWriteFuture |
AbstractCloseable.State
Modifier and Type | Field and Description |
---|---|
protected ChannelOutputStream |
os |
closeFuture, futureLock, state
log
Constructor and Description |
---|
SimpleIoOutputStream(ChannelOutputStream os) |
Modifier and Type | Method and Description |
---|---|
protected void |
doCloseImmediately()
doCloseImmediately is called once and only once with state == Immediate
|
IoWriteFuture |
writeBuffer(Buffer buffer)
Write the given buffer.
|
addCloseFutureListener, builder, close, doCloseGracefully, getFutureLock, isClosed, isClosing, preClose, 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, toString, wait, wait, wait
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
protected final ChannelOutputStream os
public SimpleIoOutputStream(ChannelOutputStream os)
protected void doCloseImmediately()
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
doCloseImmediately
in class AbstractCloseable
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 dataCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.