public abstract class BufferedOutput extends java.lang.Object implements Output
| Modifier and Type | Field and Description |
|---|---|
protected int |
bufferSize |
protected java.util.concurrent.atomic.AtomicBoolean |
isClosed |
protected CompositeBuffer |
multiBufferWindow |
protected static java.lang.Integer |
ZERO |
protected static GrizzlyFuture<java.lang.Integer> |
ZERO_READY_FUTURE |
| Constructor and Description |
|---|
BufferedOutput() |
BufferedOutput(int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
GrizzlyFuture<java.lang.Integer> |
close(CompletionHandler<java.lang.Integer> completionHandler)
Close the
StreamWriter and make sure all data was flushed. |
void |
ensureBufferCapacity(int size) |
GrizzlyFuture<java.lang.Integer> |
flush(CompletionHandler<java.lang.Integer> completionHandler)
Make sure that all data that has been written is
flushed from the stream to its destination.
|
protected abstract GrizzlyFuture<java.lang.Integer> |
flush0(Buffer buffer,
CompletionHandler<java.lang.Integer> completionHandler) |
Buffer |
getBuffer()
Return the Input's
Buffer. |
protected int |
getBufferedSize() |
boolean |
isBuffered() |
protected abstract Buffer |
newBuffer(int size) |
protected abstract void |
onClosed() |
protected abstract Buffer |
reallocateBuffer(Buffer oldBuffer,
int size) |
void |
write(Buffer bufferToWrite) |
void |
write(byte data) |
protected static final java.lang.Integer ZERO
protected static final GrizzlyFuture<java.lang.Integer> ZERO_READY_FUTURE
protected final int bufferSize
protected CompositeBuffer multiBufferWindow
protected final java.util.concurrent.atomic.AtomicBoolean isClosed
public BufferedOutput()
public BufferedOutput(int bufferSize)
protected abstract void onClosed()
throws java.io.IOException
java.io.IOExceptionprotected abstract GrizzlyFuture<java.lang.Integer> flush0(Buffer buffer, CompletionHandler<java.lang.Integer> completionHandler) throws java.io.IOException
java.io.IOExceptionprotected abstract Buffer newBuffer(int size)
public void write(byte data)
throws java.io.IOException
public void write(Buffer bufferToWrite) throws java.io.IOException
public boolean isBuffered()
isBuffered in interface Outputpublic Buffer getBuffer()
OutputBuffer.public void ensureBufferCapacity(int size)
throws java.io.IOException
ensureBufferCapacity in interface Outputjava.io.IOExceptionpublic GrizzlyFuture<java.lang.Integer> flush(CompletionHandler<java.lang.Integer> completionHandler) throws java.io.IOException
Outputpublic GrizzlyFuture<java.lang.Integer> close(CompletionHandler<java.lang.Integer> completionHandler) throws java.io.IOException
OutputStreamWriter and make sure all data was flushed.protected int getBufferedSize()
Copyright © 2013 Oracle Corporation. All Rights Reserved.