public final class LimitedBufferSlicePool extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LimitedBufferSlicePool.PooledByteBuffer |
Constructor and Description |
---|
LimitedBufferSlicePool(BufferAllocator<ByteBuffer> allocator,
int bufferSize,
int maxRegionSize)
Construct a new instance.
|
LimitedBufferSlicePool(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(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(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 © 2019 JBoss by Red Hat. All rights reserved.