public class NullByteBufferPool extends java.lang.Object implements ByteBufferPool
ByteBufferPool.Bucket, ByteBufferPool.Lease
Constructor and Description |
---|
NullByteBufferPool() |
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
acquire(int size,
boolean direct)
Requests a
ByteBuffer of the given size. |
void |
release(java.nio.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, wait
newByteBuffer, remove
public java.nio.ByteBuffer acquire(int size, boolean direct)
ByteBufferPool
Requests 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 ByteBufferPool
size
- the size of the bufferdirect
- whether the buffer must be direct or notByteBufferPool.release(ByteBuffer)
public void release(java.nio.ByteBuffer buffer)
ByteBufferPool
Returns a ByteBuffer
, usually obtained with ByteBufferPool.acquire(int, boolean)
(but not necessarily), making it available for recycling and reuse.
release
in interface ByteBufferPool
buffer
- the buffer to returnByteBufferPool.acquire(int, boolean)
Copyright © 1995–2021 Webtide. All rights reserved.