Package io.deephaven.chunk.util.pools
Class ByteChunkSoftPool
java.lang.Object
io.deephaven.chunk.util.pools.ByteChunkSoftPool
- All Implemented Interfaces:
ByteChunkPool
ByteChunkPool
implementation that pools chunks of bytes in a data structure that only enforces soft
reachability.-
Method Summary
Modifier and TypeMethodDescription<ATTR extends Any>
ResettableByteChunk<ATTR>Take aResettableByteChunk
.<ATTR extends Any>
ResettableWritableByteChunk<ATTR>Take aResettableWritableByteChunk
.<ATTR extends Any>
WritableByteChunk<ATTR>takeWritableByteChunk
(int capacity) Take aWritableByteChunk
of at least the specifiedcapacity
.
-
Method Details
-
asChunkPool
- Specified by:
asChunkPool
in interfaceByteChunkPool
- Returns:
- This ByteChunkPool as a
ChunkPool
. This is useful for passing this pool to methods that expect aChunkPool
but do not need to know the specific type.
-
takeWritableByteChunk
Description copied from interface:ByteChunkPool
Take aWritableByteChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableByteChunk
in interfaceByteChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableByteChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableByteChunk
Description copied from interface:ByteChunkPool
Take aResettableByteChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableByteChunk
in interfaceByteChunkPool
- Returns:
- A
ResettableByteChunk
that belongs to the caller untilclosed
-
takeResettableWritableByteChunk
Description copied from interface:ByteChunkPool
Take aResettableWritableByteChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableByteChunk
in interfaceByteChunkPool
- Returns:
- A
ResettableWritableByteChunk
that belongs to the caller untilclosed
-