public abstract class BufferedOutput extends Object implements Output
Modifier and Type | Field and Description |
---|---|
protected int |
bufferSize |
protected AtomicBoolean |
isClosed |
protected CompositeBuffer |
multiBufferWindow |
protected static Integer |
ZERO |
protected static GrizzlyFuture<Integer> |
ZERO_READY_FUTURE |
Constructor and Description |
---|
BufferedOutput() |
BufferedOutput(int bufferSize) |
Modifier and Type | Method and Description |
---|---|
GrizzlyFuture<Integer> |
close(CompletionHandler<Integer> completionHandler)
Close the
StreamWriter and make sure all data was flushed. |
void |
ensureBufferCapacity(int size) |
GrizzlyFuture<Integer> |
flush(CompletionHandler<Integer> completionHandler)
Make sure that all data that has been written is
flushed from the stream to its destination.
|
protected abstract GrizzlyFuture<Integer> |
flush0(Buffer buffer,
CompletionHandler<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 Integer ZERO
protected static final GrizzlyFuture<Integer> ZERO_READY_FUTURE
protected final int bufferSize
protected CompositeBuffer multiBufferWindow
protected final AtomicBoolean isClosed
public BufferedOutput()
public BufferedOutput(int bufferSize)
protected abstract void onClosed() throws IOException
IOException
protected abstract GrizzlyFuture<Integer> flush0(Buffer buffer, CompletionHandler<Integer> completionHandler) throws IOException
IOException
protected abstract Buffer newBuffer(int size)
public void write(byte data) throws IOException
write
in interface Output
IOException
public void write(Buffer bufferToWrite) throws IOException
write
in interface Output
IOException
public boolean isBuffered()
isBuffered
in interface Output
public Buffer getBuffer()
Output
Buffer
.public void ensureBufferCapacity(int size) throws IOException
ensureBufferCapacity
in interface Output
IOException
public GrizzlyFuture<Integer> flush(CompletionHandler<Integer> completionHandler) throws IOException
Output
flush
in interface Output
IOException
public GrizzlyFuture<Integer> close(CompletionHandler<Integer> completionHandler) throws IOException
Output
StreamWriter
and make sure all data was flushed.close
in interface Output
IOException
protected int getBufferedSize()
Copyright © 2014 Oracle Corporation. All rights reserved.