ByteBufferPool
, java.io.Closeable
, java.lang.AutoCloseable
public class DefaultByteBufferPool extends java.lang.Object implements ByteBufferPool
Constructor | Description |
---|---|
DefaultByteBufferPool(boolean direct,
int bufferSize) |
|
DefaultByteBufferPool(boolean direct,
int bufferSize,
int maximumPoolSize,
int threadLocalCacheSize) |
|
DefaultByteBufferPool(boolean direct,
int bufferSize,
int maximumPoolSize,
int threadLocalCacheSize,
int leakDecetionPercent) |
Modifier and Type | Method | Description |
---|---|---|
PooledByteBuffer |
allocate() |
|
void |
close() |
|
protected void |
finalize() |
|
ByteBufferPool |
getArrayBackedPool() |
If this byte buffer pool corresponds to an array backed pool then this will return itself.
|
int |
getBufferSize() |
|
boolean |
isDirect() |
public DefaultByteBufferPool(boolean direct, int bufferSize)
direct
- If this implementation should use direct buffersbufferSize
- The buffer size to usepublic DefaultByteBufferPool(boolean direct, int bufferSize, int maximumPoolSize, int threadLocalCacheSize, int leakDecetionPercent)
direct
- If this implementation should use direct buffersbufferSize
- The buffer size to usemaximumPoolSize
- The maximum pool size, in number of buffers, it does not include buffers in thread local cachesthreadLocalCacheSize
- The maximum number of buffers that can be stored in a thread local cachepublic DefaultByteBufferPool(boolean direct, int bufferSize, int maximumPoolSize, int threadLocalCacheSize)
direct
- If this implementation should use direct buffersbufferSize
- The buffer size to usemaximumPoolSize
- The maximum pool size, in number of buffers, it does not include buffers in thread local cachesthreadLocalCacheSize
- The maximum number of buffers that can be stored in a thread local cachepublic int getBufferSize()
getBufferSize
in interface ByteBufferPool
public boolean isDirect()
isDirect
in interface ByteBufferPool
public PooledByteBuffer allocate()
allocate
in interface ByteBufferPool
public ByteBufferPool getArrayBackedPool()
ByteBufferPool
getArrayBackedPool
in interface ByteBufferPool
public void close()
close
in interface java.lang.AutoCloseable
close
in interface ByteBufferPool
close
in interface java.io.Closeable
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
Copyright © 2018. All rights reserved.