Package org.eclipse.jetty.io
Interface ByteBufferPool
-
- All Known Implementing Classes:
ArrayByteBufferPool
,LeakTrackingByteBufferPool
,LogarithmicArrayByteBufferPool
,MappedByteBufferPool
,MappedByteBufferPool.Tagged
,NullByteBufferPool
@Deprecated(since="2021-05-27") public interface ByteBufferPool
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.A
ByteBuffer
pool.Acquired buffers may be
released
but they do not need to; if they are released, they may be recycled and reused, otherwise they will be garbage collected as usual.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ByteBufferPool.Bucket
Deprecated.static class
ByteBufferPool.Lease
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description java.nio.ByteBuffer
acquire(int size, boolean direct)
Deprecated.Requests aByteBuffer
of the given size.default java.nio.ByteBuffer
newByteBuffer(int capacity, boolean direct)
Deprecated.Creates a new ByteBuffer of the given capacity and the given directness.void
release(java.nio.ByteBuffer buffer)
Deprecated.Returns aByteBuffer
, usually obtained withacquire(int, boolean)
(but not necessarily), making it available for recycling and reuse.default void
remove(java.nio.ByteBuffer buffer)
Deprecated.Removes aByteBuffer
that was previously obtained withacquire(int, boolean)
.
-
-
-
Method Detail
-
acquire
java.nio.ByteBuffer acquire(int size, boolean direct)
Deprecated.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.
- Parameters:
size
- the size of the bufferdirect
- whether the buffer must be direct or not- Returns:
- the requested buffer
- See Also:
release(ByteBuffer)
-
release
void release(java.nio.ByteBuffer buffer)
Deprecated.Returns a
ByteBuffer
, usually obtained withacquire(int, boolean)
(but not necessarily), making it available for recycling and reuse.- Parameters:
buffer
- the buffer to return- See Also:
acquire(int, boolean)
-
remove
default void remove(java.nio.ByteBuffer buffer)
Deprecated.Removes a
ByteBuffer
that was previously obtained withacquire(int, boolean)
.The buffer will not be available for further reuse.
- Parameters:
buffer
- the buffer to remove- See Also:
acquire(int, boolean)
,release(ByteBuffer)
-
newByteBuffer
default java.nio.ByteBuffer newByteBuffer(int capacity, boolean direct)
Deprecated.Creates a new ByteBuffer of the given capacity and the given directness.
- Parameters:
capacity
- the ByteBuffer capacitydirect
- the ByteBuffer directness- Returns:
- a newly allocated ByteBuffer
-
-