Package org.apache.mina.common
Class SimpleByteBufferAllocator
- java.lang.Object
-
- org.apache.mina.common.SimpleByteBufferAllocator
-
- All Implemented Interfaces:
ByteBufferAllocator
public class SimpleByteBufferAllocator extends java.lang.Object implements ByteBufferAllocator
A simplisticByteBufferAllocatorwhich simply allocates a new buffer every time.
-
-
Constructor Summary
Constructors Constructor Description SimpleByteBufferAllocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufferallocate(int capacity, boolean direct)Returns the buffer which is capable of the specified size.voiddispose()Dispose of this allocator.ByteBufferwrap(java.nio.ByteBuffer nioBuffer)Wraps the specified NIOByteBufferinto MINA buffer.
-
-
-
Method Detail
-
allocate
public ByteBuffer allocate(int capacity, boolean direct)
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
public ByteBuffer wrap(java.nio.ByteBuffer nioBuffer)
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
-
-