public class SimpleBufferAllocator extends Object implements IoBufferAllocator
IoBufferAllocator which simply allocates a new buffer
every time.| 构造器和说明 |
|---|
SimpleBufferAllocator() |
| 限定符和类型 | 方法和说明 |
|---|---|
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. |
public IoBuffer allocate(int capacity, boolean direct)
IoBufferAllocatorallocate 在接口中 IoBufferAllocatorcapacity - the capacity of the bufferdirect - true to get a direct buffer, false to get a
heap buffer.public ByteBuffer allocateNioBuffer(int capacity, boolean direct)
IoBufferAllocatorallocateNioBuffer 在接口中 IoBufferAllocatorcapacity - the capacity of the bufferdirect - true to get a direct buffer, false to get a
heap buffer.public IoBuffer wrap(ByteBuffer nioBuffer)
IoBufferAllocatorByteBuffer into MINA buffer.wrap 在接口中 IoBufferAllocatorpublic void dispose()
IoBufferAllocatordispose 在接口中 IoBufferAllocatorCopyright © 2013. All Rights Reserved.