public final class LimitedBufferSlicePool extends Object
Modifier and Type | Class and Description |
---|---|
static class | LimitedBufferSlicePool.PooledByteBuffer |
Constructor and Description |
---|
LimitedBufferSlicePool(org.xnio.BufferAllocator<ByteBuffer> allocator, int bufferSize, int maxRegionSize) Construct a new instance. |
LimitedBufferSlicePool(org.xnio.BufferAllocator<ByteBuffer> allocator, int bufferSize, int maxRegionSize, int maxRegions) Construct a new instance. |
LimitedBufferSlicePool(int bufferSize, int maxRegionSize) Construct a new instance, using a direct buffer allocator. |
Modifier and Type | Method and Description |
---|---|
LimitedBufferSlicePool.PooledByteBuffer | allocate() Allocates a new byte buffer if possible |
boolean | canAllocate(int slices) |
public LimitedBufferSlicePool(org.xnio.BufferAllocator<ByteBuffer> allocator, int bufferSize, int maxRegionSize, int maxRegions)
allocator
- the buffer allocator to usebufferSize
- the size of each buffermaxRegionSize
- the maximum region size for each backing buffermaxRegions
- the maximum regions to create, zero for unlimitedpublic LimitedBufferSlicePool(org.xnio.BufferAllocator<ByteBuffer> allocator, int bufferSize, int maxRegionSize)
allocator
- the buffer allocator to usebufferSize
- the size of each buffermaxRegionSize
- the maximum region size for each backing bufferpublic LimitedBufferSlicePool(int bufferSize, int maxRegionSize)
bufferSize
- the size of each buffermaxRegionSize
- the maximum region size for each backing bufferpublic LimitedBufferSlicePool.PooledByteBuffer allocate()
public boolean canAllocate(int slices)
Copyright © 2015 JBoss by Red Hat. All rights reserved.