@InterfaceAudience.Public
@InterfaceStability.Stable
public interface ByteBufferPool
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
getBuffer(boolean direct,
int length)
Get a new direct ByteBuffer.
|
void |
putBuffer(ByteBuffer buffer)
Release a buffer back to the pool.
|
default void |
release()
Clear the buffer pool thus releasing all the buffers.
|
ByteBuffer getBuffer(boolean direct, int length)
direct
- Whether the buffer should be direct.length
- The minimum length the buffer will have.void putBuffer(ByteBuffer buffer)
buffer
- a direct bytebufferdefault void release()
Copyright © 2023 Apache Software Foundation. All rights reserved.