Package org.apache.mina.common
Class SimpleByteBufferAllocator
java.lang.Object
org.apache.mina.common.SimpleByteBufferAllocator
- All Implemented Interfaces:
ByteBufferAllocator
A simplistic
ByteBufferAllocator
which simply allocates a new
buffer every time.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocate
(int capacity, boolean direct) Returns the buffer which is capable of the specified size.void
dispose()
Dispose of this allocator.wrap
(ByteBuffer nioBuffer) Wraps the specified NIOByteBuffer
into MINA buffer.
-
Constructor Details
-
SimpleByteBufferAllocator
public SimpleByteBufferAllocator()
-
-
Method Details
-
allocate
Description copied from interface:ByteBufferAllocator
Returns the buffer which is capable of the specified size.- Specified by:
allocate
in interfaceByteBufferAllocator
- Parameters:
capacity
- the capacity of the bufferdirect
- true to get a direct buffer, false to get a heap buffer.
-
wrap
Description copied from interface:ByteBufferAllocator
Wraps the specified NIOByteBuffer
into MINA buffer.- Specified by:
wrap
in interfaceByteBufferAllocator
-
dispose
public void dispose()Description copied from interface:ByteBufferAllocator
Dispose of this allocator.- Specified by:
dispose
in interfaceByteBufferAllocator
-