rabbit.io
Interface BufferHandler

All Known Implementing Classes:
CachingBufferHandler

public interface BufferHandler

A ByteBuffer handler

Author:
Robert Olofsson

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.
 

Method Detail

getBuffer

ByteBuffer getBuffer()
Get a byte buffer of reasonable size, the buffer will have been cleared.


putBuffer

void putBuffer(ByteBuffer buffer)
Return a buffer.


growBuffer

ByteBuffer growBuffer(ByteBuffer buffer)
Get a larger buffer with the same contents as buffer, this will also return buffer to the pool.

Parameters:
buffer - an existing buffer, the contents will be copied into the new larger buffer. May be null.