CachingBufferHandler (RabbIT/4)
Date: 2009-10-13

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rabbit.io
Class CachingBufferHandler

    java.lang.Object
      rabbit.io.CachingBufferHandler

All Implemented Interfaces:
  BufferHandler

    public class CachingBufferHandler

extends Object
implements BufferHandler

A ByteBuffer handler that keeps re uses returned buffers. This class uses no synchronization. This class only allocates direct buffers.

Author:
  Robert Olofsson

Constructor Summary
`CachingBufferHandler()`

Method Summary
`ByteBuffer` | `getBuffer()` Get a byte buffer of reasonable size, the buffer will have been cleared.
`ByteBuffer` | `growBuffer(ByteBuffer buffer)` Get a larger buffer with the same contents as buffer, this will also return buffer to the pool.
`void` | `putBuffer(ByteBuffer buffer)` Return a buffer.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CachingBufferHandler

    public CachingBufferHandler()

Method Detail

### getBuffer

    public ByteBuffer getBuffer()

  Description copied from interface: `BufferHandler`
  Get a byte buffer of reasonable size, the buffer will have been cleared.

  Specified by:
    `getBuffer` in interface `BufferHandler`

### putBuffer

    public void putBuffer(ByteBuffer buffer)

  Description copied from interface: `BufferHandler`
  Return a buffer.

  Specified by:
    `putBuffer` in interface `BufferHandler`

### growBuffer

    public ByteBuffer growBuffer(ByteBuffer buffer)

  Description copied from interface: `BufferHandler`
  Get a larger buffer with the same contents as buffer, this will also return buffer to the pool.

  Specified by:
    `growBuffer` in interface `BufferHandler`
  Parameters:
    `buffer` - an existing buffer, the contents will be copied into the new larger buffer. May be null.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD