Class ByteBufferPool.Sized
java.lang.Object
org.eclipse.jetty.io.ByteBufferPool.Wrapper
org.eclipse.jetty.io.ByteBufferPool.Sized
- All Implemented Interfaces:
ByteBufferPool
- Enclosing interface:
ByteBufferPool
A ByteBufferPool with an additional no-args
acquire() method to obtain a buffer of a
preconfigured specific size and type.-
Nested Class Summary
Nested classes/interfaces inherited from interface ByteBufferPool
ByteBufferPool.Accumulator, ByteBufferPool.NonPooling, ByteBufferPool.Sized, ByteBufferPool.Wrapper -
Field Summary
Fields inherited from interface ByteBufferPool
NON_POOLING, SIZED_NON_POOLING -
Constructor Summary
ConstructorsConstructorDescriptionSized(ByteBufferPool wrapped) Create a sized pool for non direct buffers of a default size from a wrapped pool.Sized(ByteBufferPool wrapped, boolean direct, int size) Create a sized pool for a give directness and size from a wrapped pool. -
Method Summary
Methods inherited from class ByteBufferPool.Wrapper
acquire, clear, getWrappedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ByteBufferPool
removeAndRelease
-
Constructor Details
-
Sized
Create a sized pool for non direct buffers of a default size from a wrapped pool.- Parameters:
wrapped- The actualByteBufferPool
-
Sized
Create a sized pool for a give directness and size from a wrapped pool.- Parameters:
wrapped- The actualByteBufferPooldirect-truefor direct buffers.size- The specified size in bytes of the buffer, any value less than 1 means use a default value.
-
-
Method Details
-
isDirect
public boolean isDirect() -
getSize
public int getSize() -
acquire
- Returns:
- A
RetainableByteBuffersuitable for the specified preconfigured size and type.
-
acquire
- Parameters:
size- The specified size in bytes of the buffer- Returns:
- A
RetainableByteBuffersuitable for the specified preconfigured type.
-
acquire
- Parameters:
direct- true for a direct byte buffer, false otherwise- Returns:
- A
RetainableByteBuffersuitable for the specified preconfigured size.
-