public class MappedByteBufferPool extends Object implements ByteBufferPool
| Modifier and Type | Class and Description |
|---|---|
static class |
MappedByteBufferPool.Tagged |
ByteBufferPool.Bucket, ByteBufferPool.Lease| Constructor and Description |
|---|
MappedByteBufferPool() |
MappedByteBufferPool(int factor) |
MappedByteBufferPool(int factor,
int maxQueue) |
MappedByteBufferPool(int factor,
int maxQueue,
Function<Integer,ByteBufferPool.Bucket> newBucket) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
acquire(int size,
boolean direct)
Requests a
ByteBuffer of the given size. |
void |
clear() |
void |
release(ByteBuffer buffer)
Returns a
ByteBuffer, usually obtained with ByteBufferPool.acquire(int, boolean)
(but not necessarily), making it available for recycling and reuse. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewByteBufferpublic MappedByteBufferPool()
public MappedByteBufferPool(int factor)
public MappedByteBufferPool(int factor,
int maxQueue)
public MappedByteBufferPool(int factor,
int maxQueue,
Function<Integer,ByteBufferPool.Bucket> newBucket)
public ByteBuffer acquire(int size, boolean direct)
ByteBufferPoolRequests a ByteBuffer of the given size.
The returned buffer may have a bigger capacity than the size being requested but it will have the limit set to the given size.
acquire in interface ByteBufferPoolsize - the size of the bufferdirect - whether the buffer must be direct or notByteBufferPool.release(ByteBuffer)public void release(ByteBuffer buffer)
ByteBufferPoolReturns a ByteBuffer, usually obtained with ByteBufferPool.acquire(int, boolean)
(but not necessarily), making it available for recycling and reuse.
release in interface ByteBufferPoolbuffer - the buffer to returnByteBufferPool.acquire(int, boolean)public void clear()
Copyright © 1995–2016 Webtide. All rights reserved.