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.voiddispose()Dispose of this allocator.wrap(ByteBuffer nioBuffer) Wraps the specified NIOByteBufferinto MINA buffer.
-
Constructor Details
-
SimpleByteBufferAllocator
public SimpleByteBufferAllocator()
-
-
Method Details
-
allocate
Description copied from interface:ByteBufferAllocatorReturns the buffer which is capable of the specified size.- Specified by:
allocatein 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:ByteBufferAllocatorWraps the specified NIOByteBufferinto MINA buffer.- Specified by:
wrapin interfaceByteBufferAllocator
-
dispose
public void dispose()Description copied from interface:ByteBufferAllocatorDispose of this allocator.- Specified by:
disposein interfaceByteBufferAllocator
-