Package com.google.code.yanf4j.buffer
Interface IoBufferAllocator
-
- All Known Implementing Classes:
CachedBufferAllocator
,SimpleBufferAllocator
public interface IoBufferAllocator
AllocatesIoBuffer
s and manages them. Please implement this interface if you need more advanced memory management scheme.- Version:
- $Rev: 671827 $, $Date: 2008-06-26 10:49:48 +0200 (Thu, 26 Jun 2008) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IoBuffer
allocate(int capacity, boolean direct)
Returns the buffer which is capable of the specified size.java.nio.ByteBuffer
allocateNioBuffer(int capacity, boolean direct)
Returns the NIO buffer which is capable of the specified size.void
dispose()
Dispose of this allocator.IoBuffer
wrap(java.nio.ByteBuffer nioBuffer)
Wraps the specified NIOByteBuffer
into MINA buffer.
-
-
-
Method Detail
-
allocate
IoBuffer 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.
-
allocateNioBuffer
java.nio.ByteBuffer allocateNioBuffer(int capacity, boolean direct)
Returns the NIO 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
IoBuffer wrap(java.nio.ByteBuffer nioBuffer)
Wraps the specified NIOByteBuffer
into MINA buffer.
-
dispose
void dispose()
Dispose of this allocator.
-
-