public class LimitWriteOperationsReuseBuffers extends Object
| Constructor and Description |
|---|
LimitWriteOperationsReuseBuffers(IO.Writable io,
int bufferSize,
int maxOperations)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
freeBuffer(ByteBuffer buffer)
Must be called only if the user has not been used for a write operation,
else it will be automatically free when write operation is done.
|
ByteBuffer |
getBuffer()
Return a buffer to put data to write.
|
AsyncWork<Integer,IOException> |
getLastPendingOperation()
Return the last pending operation, or null.
|
AsyncWork<Integer,IOException> |
write(ByteBuffer buffer)
Queue the buffer to write.
|
public LimitWriteOperationsReuseBuffers(IO.Writable io, int bufferSize, int maxOperations)
public ByteBuffer getBuffer()
public void freeBuffer(ByteBuffer buffer)
public AsyncWork<Integer,IOException> write(ByteBuffer buffer) throws IOException
buffer - the buffer to write.IOExceptionpublic AsyncWork<Integer,IOException> getLastPendingOperation()
Copyright © 2017. All rights reserved.