ByteBufferManager manager = new ByteBufferManager(bufferSize);
return new ByteBufferPool(new SoftRefPool<ByteBuffer>(manager, maxEntries));
}
public static ByteBufferPool create(int bufferSize, int maxEntries, int concurrencyLevel) {
ByteBufferManager manager = new ByteBufferManager(bufferSize);
if (concurrencyLevel < 2) {
return new ByteBufferPool(new SoftRefPool<ByteBuffer>(manager, maxEntries));
}
return new ByteBufferPool(new ConcurrentPool<ByteBuffer>(manager, maxEntries, true, concurrencyLevel));
}