Package org.apache.mina.common
Interface ByteBufferAllocator
-
- All Known Implementing Classes:
PooledByteBufferAllocator,SimpleByteBufferAllocator
public interface ByteBufferAllocatorAllocatesByteBuffers and manages them. Please implement this interface if you need more advanced memory management scheme.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ByteBufferallocate(int capacity, boolean direct)Returns the buffer which is capable of the specified size.voiddispose()Dispose of this allocator.ByteBufferwrap(java.nio.ByteBuffer nioBuffer)Wraps the specified NIOByteBufferinto MINA buffer.
-
-
-
Method Detail
-
allocate
ByteBuffer allocate(int capacity, boolean direct)
Returns the buffer which is capable of the specified size.- Parameters:
capacity- the capacity of the bufferdirect- true to get a direct buffer, false to get a heap buffer.
-
wrap
ByteBuffer wrap(java.nio.ByteBuffer nioBuffer)
Wraps the specified NIOByteBufferinto MINA buffer.
-
dispose
void dispose()
Dispose of this allocator.
-
-