ByteBufferAllocatorpublic class SimpleByteBufferAllocator extends java.lang.Object implements ByteBufferAllocator
ByteBufferAllocator which simply allocates a new
buffer every time.| Constructor | Description |
|---|---|
SimpleByteBufferAllocator() |
| Modifier and Type | Method | Description |
|---|---|---|
ByteBuffer |
allocate(int capacity,
boolean direct) |
Returns the buffer which is capable of the specified size.
|
void |
dispose() |
Dispose of this allocator.
|
ByteBuffer |
wrap(java.nio.ByteBuffer nioBuffer) |
Wraps the specified NIO
ByteBuffer into MINA buffer. |
public ByteBuffer allocate(int capacity, boolean direct)
ByteBufferAllocatorallocate in interface ByteBufferAllocatorcapacity - the capacity of the bufferdirect - true to get a direct buffer,
false to get a heap buffer.public ByteBuffer wrap(java.nio.ByteBuffer nioBuffer)
ByteBufferAllocatorByteBuffer into MINA buffer.wrap in interface ByteBufferAllocatorpublic void dispose()
ByteBufferAllocatordispose in interface ByteBufferAllocator