Package com.github.luben.zstd
Interface BufferPool
- All Known Implementing Classes:
NoPool
,RecyclingBufferPool
public interface BufferPool
An an interface that allows users to customize how buffers are recycled.
-
Method Summary
Modifier and TypeMethodDescriptionget
(int capacity) Fetch a buffer from the pool.void
release
(ByteBuffer buffer) Return a buffer to the pool.
-
Method Details
-
get
Fetch a buffer from the pool.- Parameters:
capacity
- the desired size of the buffer- Returns:
- a heap buffer with size at least the `capacity` and arrayOffset of 0
-
release
Return a buffer to the pool.- Parameters:
buffer
- the buffer to return
-