ByteBufferPool
.public final class ByteBufferSlicePool extends Object implements Pool<ByteBuffer>
clean()
to make
sure that direct allocated buffers can be reused by a future instance.Constructor and Description |
---|
ByteBufferSlicePool(BufferAllocator<ByteBuffer> allocator,
int bufferSize,
int maxRegionSize)
Deprecated.
Construct a new instance.
|
ByteBufferSlicePool(BufferAllocator<ByteBuffer> allocator,
int bufferSize,
int maxRegionSize,
int threadLocalQueueSize)
Deprecated.
Construct a new instance.
|
ByteBufferSlicePool(int bufferSize,
int maxRegionSize)
Deprecated.
Construct a new instance, using a direct buffer allocator.
|
Modifier and Type | Method and Description |
---|---|
Pooled<ByteBuffer> |
allocate()
Deprecated.
Allocate a resource from the pool.
|
void |
clean()
Deprecated.
Cleans the pool, removing references to any buffers inside it.
|
int |
getBufferSize()
Deprecated.
Return the size of the
ByteBuffer s that are returned by allocate() . |
public ByteBufferSlicePool(BufferAllocator<ByteBuffer> allocator, int bufferSize, int maxRegionSize, int threadLocalQueueSize)
allocator
- the buffer allocator to usebufferSize
- the size of each buffermaxRegionSize
- the maximum region size for each backing bufferthreadLocalQueueSize
- the number of buffers to cache on each threadpublic ByteBufferSlicePool(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 ByteBufferSlicePool(int bufferSize, int maxRegionSize)
bufferSize
- the size of each buffermaxRegionSize
- the maximum region size for each backing bufferpublic Pooled<ByteBuffer> allocate()
allocate
in interface Pool<ByteBuffer>
public void clean()
public int getBufferSize()
ByteBuffer
s that are returned by allocate()
.Copyright © 2021 JBoss by Red Hat. All rights reserved.