2015/07/26 - Apache DirectMemory has been retired.

For more information, please explore the Attic.

public class

FixedSizeByteBufferAllocatorImpl

extends AbstractByteBufferAllocator
java.lang.Object
   ↳ org.apache.directmemory.memory.allocator.AbstractByteBufferAllocator
     ↳ org.apache.directmemory.memory.allocator.FixedSizeByteBufferAllocatorImpl

Class Overview

Allocator implementation that instantiate ByteBuffers of fixed size, called slices.

Summary

[Expand]
Inherited Fields
From class org.apache.directmemory.memory.allocator.AbstractByteBufferAllocator
Public Constructors
FixedSizeByteBufferAllocatorImpl(int number, int totalSize, int sliceSize, int numberOfSegments)
Constructor.
Public Methods
MemoryBuffer allocate(int size)
void clear()
void close()
void free(MemoryBuffer buffer)
int getCapacity()
int getSliceSize()
Protected Methods
ByteBuffer findFreeBuffer(int capacity)
void init(int numberOfSegments)
[Expand]
Inherited Methods
From class org.apache.directmemory.memory.allocator.AbstractByteBufferAllocator
From class java.lang.Object
From interface java.io.Closeable
From interface org.apache.directmemory.memory.allocator.Allocator

Public Constructors

public FixedSizeByteBufferAllocatorImpl (int number, int totalSize, int sliceSize, int numberOfSegments)

Constructor.

Parameters
number : internal identifier of the allocator
totalSize : the internal buffer
sliceSize : arbitrary number of the buffer.
numberOfSegments : number of parent ByteBuffer to allocate.

Public Methods

public MemoryBuffer allocate (int size)

public void clear ()

public void close ()

public void free (MemoryBuffer buffer)

public int getCapacity ()

public int getSliceSize ()

Protected Methods

protected ByteBuffer findFreeBuffer (int capacity)

protected void init (int numberOfSegments)