@Deprecated public class CachedBufferAllocator extends Object implements BufferAllocator
Modifier and Type | Class and Description |
---|---|
class |
CachedBufferAllocator.CachedIoBuffer
Deprecated.
|
Constructor and Description |
---|
CachedBufferAllocator()
Deprecated.
Creates a new instance with the default parameters (#DEFAULT_MAX_POOL_SIZE and
#DEFAULT_MAX_CACHED_BUFFER_SIZE).
|
CachedBufferAllocator(int maxPoolSize,
int maxCachedBufferSize)
Deprecated.
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
IoBuffer |
allocate(int requestedCapacity)
Deprecated.
|
void |
dispose()
Deprecated.
|
int |
getMaxCachedBufferSize()
Deprecated.
|
int |
getMaxPoolSize()
Deprecated.
|
static BufferAllocator |
newInstance()
Deprecated.
|
static BufferAllocator |
newInstance(int maxPoolSize,
int maxCachedBufferSize)
Deprecated.
|
IoBuffer |
wrap(ByteBuffer nioBuffer)
Deprecated.
|
public CachedBufferAllocator()
public CachedBufferAllocator(int maxPoolSize, int maxCachedBufferSize)
maxPoolSize
- the maximum number of buffers with the same capacity per thread. 0
disables this limitation.maxCachedBufferSize
- the maximum capacity of a cached buffer. A buffer whose capacity is
bigger than this value is not pooled. 0 disables this limitation.public int getMaxPoolSize()
public int getMaxCachedBufferSize()
public final IoBuffer allocate(int requestedCapacity)
allocate
in interface BufferAllocator
public final IoBuffer wrap(ByteBuffer nioBuffer)
wrap
in interface BufferAllocator
public void dispose()
dispose
in interface BufferAllocator
public static BufferAllocator newInstance()
public static BufferAllocator newInstance(int maxPoolSize, int maxCachedBufferSize)
Copyright © 2021. All rights reserved.