|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.core.buffer.SimpleBufferAllocator
public class SimpleBufferAllocator
A simplistic IoBufferAllocator
which simply allocates a new
buffer every time.
Constructor Summary | |
---|---|
SimpleBufferAllocator()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleBufferAllocator()
Method Detail |
---|
public IoBuffer allocate(int capacity, boolean direct)
IoBufferAllocator
allocate
in interface IoBufferAllocator
capacity
- the capacity of the bufferdirect
- true to get a direct buffer,
false to get a heap buffer.public ByteBuffer allocateNioBuffer(int capacity, boolean direct)
IoBufferAllocator
allocateNioBuffer
in interface IoBufferAllocator
capacity
- the capacity of the bufferdirect
- true to get a direct buffer,
false to get a heap buffer.public IoBuffer wrap(ByteBuffer nioBuffer)
IoBufferAllocator
ByteBuffer
into MINA buffer.
wrap
in interface IoBufferAllocator
public void dispose()
IoBufferAllocator
dispose
in interface IoBufferAllocator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |