|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrabbit.io.SimpleBufferHandle
public class SimpleBufferHandle
A handle to a ByteBuffer.
Constructor Summary | |
---|---|
SimpleBufferHandle(ByteBuffer buffer)
Create a BufferHandle that wraps the given ByteBuffer. |
Method Summary | |
---|---|
ByteBuffer |
getBuffer()
Get a byte buffer of reasonable size, the buffer will have been cleared. |
ByteBuffer |
getLargeBuffer()
Get a byte buffer of reasonable size, the buffer will have been cleared. |
boolean |
isEmpty()
Check if this handle is empty, that is if no buffer exists or the buffer is empty. |
boolean |
isLarge(ByteBuffer buffer)
Check if the given buffer is a large buffer |
void |
possiblyFlush()
release a buffer if possible. |
void |
setMayBeFlushed(boolean mayBeFlushed)
Flag that the internal ByteBuffer may not be flushed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleBufferHandle(ByteBuffer buffer)
buffer
- the ByteBuffer to wrapMethod Detail |
---|
public boolean isEmpty()
BufferHandle
isEmpty
in interface BufferHandle
public ByteBuffer getBuffer()
BufferHandle
getBuffer
in interface BufferHandle
public ByteBuffer getLargeBuffer()
BufferHandle
getLargeBuffer
in interface BufferHandle
public boolean isLarge(ByteBuffer buffer)
BufferHandle
isLarge
in interface BufferHandle
buffer
- the ByteBuffer to check
public void possiblyFlush()
BufferHandle
possiblyFlush
in interface BufferHandle
public void setMayBeFlushed(boolean mayBeFlushed)
BufferHandle
setMayBeFlushed
in interface BufferHandle
mayBeFlushed
- if true the buffer may be returned,
if false the putBuffer call will throw an exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |