org.apache.mina.common
Class SimpleByteBufferAllocator
java.lang.Object
org.apache.mina.common.SimpleByteBufferAllocator
- All Implemented Interfaces:
- ByteBufferAllocator
public class SimpleByteBufferAllocator
- extends Object
- implements ByteBufferAllocator
A simplistic ByteBufferAllocator
which simply allocates a new
buffer every time.
- Version:
- $Rev: 391231 $, $Date: 2006-04-04 15:21:55 +0900 (Tue, 04 Apr 2006) $
- Author:
- The Apache Directory Project (mina-dev@directory.apache.org)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleByteBufferAllocator
public SimpleByteBufferAllocator()
allocate
public ByteBuffer allocate(int capacity,
boolean direct)
- Description copied from interface:
ByteBufferAllocator
- Returns the buffer which is capable of the specified size.
- Specified by:
allocate
in interface ByteBufferAllocator
- Parameters:
capacity
- the capacity of the bufferdirect
- true to get a direct buffer,
false to get a heap buffer.
wrap
public ByteBuffer wrap(ByteBuffer nioBuffer)
- Description copied from interface:
ByteBufferAllocator
- Wraps the specified NIO
ByteBuffer
into MINA buffer.
- Specified by:
wrap
in interface ByteBufferAllocator