public class SimpleBufferAllocator extends java.lang.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.
|
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 NIO
ByteBuffer into MINA buffer. |
public IoBuffer allocate(int capacity, boolean direct)
IoBufferAllocator
allocate
在接口中 IoBufferAllocator
capacity
- the capacity of the bufferdirect
- true to get a direct buffer,
false to get a heap buffer.IoBuffer
public java.nio.ByteBuffer allocateNioBuffer(int capacity, boolean direct)
IoBufferAllocator
allocateNioBuffer
在接口中 IoBufferAllocator
capacity
- the capacity of the bufferdirect
- true to get a direct buffer,
false to get a heap buffer.ByteBuffer
public IoBuffer wrap(java.nio.ByteBuffer nioBuffer)
IoBufferAllocator
ByteBuffer
into MINA buffer.wrap
在接口中 IoBufferAllocator
nioBuffer
- The ByteBuffer
to wrapIoBuffer
wrapping the ByteBuffer
public void dispose()
IoBufferAllocator
dispose
在接口中 IoBufferAllocator