rabbit.io
Class CacheBufferHandle

java.lang.Object
  extended by rabbit.io.CacheBufferHandle
All Implemented Interfaces:
BufferHandle

public class CacheBufferHandle
extends Object
implements BufferHandle

A handle to a ByteBuffer that uses a buffer handler

Author:
Robert Olofsson

Constructor Summary
CacheBufferHandle(BufferHandler bh)
           
 
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.
 void possiblyFlush()
          release a buffer if possible.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheBufferHandle

public CacheBufferHandle(BufferHandler bh)
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: BufferHandle
Check if this handle is empty, that is if no buffer exists or the buffer is empty.

Specified by:
isEmpty in interface BufferHandle

getBuffer

public ByteBuffer getBuffer()
Description copied from interface: BufferHandle
Get a byte buffer of reasonable size, the buffer will have been cleared.

Specified by:
getBuffer in interface BufferHandle

getLargeBuffer

public ByteBuffer getLargeBuffer()
Description copied from interface: BufferHandle
Get a byte buffer of reasonable size, the buffer will have been cleared.

Specified by:
getLargeBuffer in interface BufferHandle

possiblyFlush

public void possiblyFlush()
Description copied from interface: BufferHandle
release a buffer if possible.

Specified by:
possiblyFlush in interface BufferHandle

toString

public String toString()
Overrides:
toString in class Object