|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrabbit.io.CacheBufferHandle
public class CacheBufferHandle
A handle to a ByteBuffer that uses a buffer handler
| Constructor Summary | |
|---|---|
CacheBufferHandle(BufferHandler bh)
Create a new CacheBufferHandle that uses the given BufferHandler for the caching of the ByteBuffer:s |
|
| Method Summary | |
|---|---|
java.nio.ByteBuffer |
getBuffer()
Get a byte buffer of reasonable size, the buffer will have been cleared. |
java.nio.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(java.nio.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. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CacheBufferHandle(BufferHandler bh)
bh - the BufferHandler that is the actual cache| Method Detail |
|---|
public boolean isEmpty()
BufferHandle
isEmpty in interface BufferHandlepublic java.nio.ByteBuffer getBuffer()
BufferHandle
getBuffer in interface BufferHandlepublic java.nio.ByteBuffer getLargeBuffer()
BufferHandle
getLargeBuffer in interface BufferHandlepublic boolean isLarge(java.nio.ByteBuffer buffer)
BufferHandle
isLarge in interface BufferHandlebuffer - the ByteBuffer to check
public void possiblyFlush()
BufferHandle
possiblyFlush in interface BufferHandlepublic void setMayBeFlushed(boolean mayBeFlushed)
BufferHandle
setMayBeFlushed in interface BufferHandlemayBeFlushed - if true the buffer may be returned,
if false the putBuffer call will throw an exceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||