CachedBufferAllocator, SimpleBufferAllocatorpublic interface IoBufferAllocator
IoBuffers and manages them. Please implement this
interface if you need more advanced memory management scheme.| Modifier and Type | Method | Description |
|---|---|---|
IoBuffer |
allocate(int capacity,
boolean direct) |
Returns the buffer which is capable of the specified size.
|
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(ByteBuffer nioBuffer) |
Wraps the specified NIO
ByteBuffer into MINA buffer. |
IoBuffer allocate(int capacity, boolean direct)
capacity - the capacity of the bufferdirect - true to get a direct buffer,
false to get a heap buffer.IoBufferByteBuffer allocateNioBuffer(int capacity, boolean direct)
capacity - the capacity of the bufferdirect - true to get a direct buffer,
false to get a heap buffer.ByteBufferIoBuffer wrap(ByteBuffer nioBuffer)
ByteBuffer into MINA buffer.nioBuffer - The ByteBuffer to wrapIoBuffer wrapping the ByteBuffervoid dispose()
Copyright © 2004–2018 Apache MINA Project. All rights reserved.