Package org.eclipse.jetty.io
Class MappedByteBufferPool
- java.lang.Object
-
- org.eclipse.jetty.io.MappedByteBufferPool
-
- All Implemented Interfaces:
ByteBufferPool
- Direct Known Subclasses:
MappedByteBufferPool.Tagged
public class MappedByteBufferPool extends Object implements ByteBufferPool
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMappedByteBufferPool.Tagged-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Bucket, ByteBufferPool.Lease
-
-
Constructor Summary
Constructors Constructor Description MappedByteBufferPool()MappedByteBufferPool(int factor)MappedByteBufferPool(int factor, int maxQueue)MappedByteBufferPool(int factor, int maxQueue, Function<Integer,ByteBufferPool.Bucket> newBucket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufferacquire(int size, boolean direct)Requests aByteBufferof the given size.voidclear()voidrelease(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
-
-
-
-
Constructor Detail
-
MappedByteBufferPool
public MappedByteBufferPool()
-
MappedByteBufferPool
public MappedByteBufferPool(int factor)
-
MappedByteBufferPool
public MappedByteBufferPool(int factor, int maxQueue)
-
MappedByteBufferPool
public MappedByteBufferPool(int factor, int maxQueue, Function<Integer,ByteBufferPool.Bucket> newBucket)
-
-
Method Detail
-
acquire
public ByteBuffer acquire(int size, boolean direct)
Description copied from interface:ByteBufferPoolRequests a
ByteBufferof 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.
- Specified by:
acquirein interfaceByteBufferPool- Parameters:
size- the size of the bufferdirect- whether the buffer must be direct or not- Returns:
- the requested buffer
- See Also:
ByteBufferPool.release(ByteBuffer)
-
release
public void release(ByteBuffer buffer)
Description copied from interface:ByteBufferPoolReturns a
ByteBuffer, usually obtained withByteBufferPool.acquire(int, boolean)(but not necessarily), making it available for recycling and reuse.- Specified by:
releasein interfaceByteBufferPool- Parameters:
buffer- the buffer to return- See Also:
ByteBufferPool.acquire(int, boolean)
-
clear
public void clear()
-
-