Package org.eclipse.jetty.io
Class NullByteBufferPool
java.lang.Object
org.eclipse.jetty.io.NullByteBufferPool
- All Implemented Interfaces:
ByteBufferPool
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Lease
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionacquire
(int size, boolean direct) Requests aByteBuffer
of the given size.Get this pool as aRetainableByteBufferPool
, which supports reference counting of the buffers and possibly a more efficient lookup mechanism based on thePool
class.void
release
(ByteBuffer buffer) Returns aByteBuffer
, usually obtained withByteBufferPool.acquire(int, boolean)
(but not necessarily), making it available for recycling and reuse.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.io.ByteBufferPool
newByteBuffer, remove
-
Constructor Details
-
NullByteBufferPool
public NullByteBufferPool()
-
-
Method Details
-
acquire
Description copied from interface:ByteBufferPool
Requests a
ByteBuffer
of the given size.The returned buffer may have a bigger capacity than the size being requested.
- Specified by:
acquire
in interfaceByteBufferPool
- Parameters:
size
- the size of the bufferdirect
- whether the buffer must be direct or not- Returns:
- a buffer with at least the requested capacity, with position and limit set to 0.
- See Also:
-
release
Description copied from interface:ByteBufferPool
Returns a
ByteBuffer
, usually obtained withByteBufferPool.acquire(int, boolean)
(but not necessarily), making it available for recycling and reuse.- Specified by:
release
in interfaceByteBufferPool
- Parameters:
buffer
- the buffer to return- See Also:
-
asRetainableByteBufferPool
Description copied from interface:ByteBufferPool
Get this pool as aRetainableByteBufferPool
, which supports reference counting of the buffers and possibly a more efficient lookup mechanism based on thePool
class.- Specified by:
asRetainableByteBufferPool
in interfaceByteBufferPool
- Returns:
- This pool as a RetainableByteBufferPool. The same instance is always returned by multiple calls to this method.
-