public class SimpleByteBufferAllocator extends java.lang.Object implements ByteBufferAllocator
ByteBufferAllocator
which simply allocates a new
buffer every time.Constructor and Description |
---|
SimpleByteBufferAllocator() |
Modifier and Type | Method and 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)
ByteBufferAllocator
allocate
in interface ByteBufferAllocator
capacity
- the capacity of the bufferdirect
- true to get a direct buffer,
false to get a heap buffer.public ByteBuffer wrap(java.nio.ByteBuffer nioBuffer)
ByteBufferAllocator
ByteBuffer
into MINA buffer.wrap
in interface ByteBufferAllocator
public void dispose()
ByteBufferAllocator
dispose
in interface ByteBufferAllocator
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.