Package com.github.luben.zstd
Class NoPool
- java.lang.Object
-
- com.github.luben.zstd.NoPool
-
- All Implemented Interfaces:
BufferPool
public class NoPool extends java.lang.Object implements BufferPool
Implementation of `BufferPool` that does not recycle buffers.
-
-
Field Summary
Fields Modifier and Type Field Description static @NotNull BufferPoolINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.nio.ByteBufferget(int capacity)Fetch a buffer from the pool.voidrelease(@NotNull java.nio.ByteBuffer buffer)Return a buffer to the pool.
-
-
-
Field Detail
-
INSTANCE
@NotNull public static final @NotNull BufferPool INSTANCE
-
-
Method Detail
-
get
@NotNull public @NotNull java.nio.ByteBuffer get(int capacity)
Description copied from interface:BufferPoolFetch a buffer from the pool.- Specified by:
getin interfaceBufferPool- Parameters:
capacity- the desired size of the buffer- Returns:
- a heap buffer with size at least the `capacity` and arrayOffset of 0
-
release
public void release(@NotNull @NotNull java.nio.ByteBuffer buffer)Description copied from interface:BufferPoolReturn a buffer to the pool.- Specified by:
releasein interfaceBufferPool- Parameters:
buffer- the buffer to return
-
-