Uses of Interface
org.jgrapes.io.util.BufferCollector
Package
Description
Utility classes, mainly for adapted buffers to specific needs.
-
Uses of BufferCollector in org.jgrapes.io.util
Modifier and TypeClassDescriptionclass
ManagedBufferPool<W extends ManagedBuffer<T>,
T extends Buffer> A queue based buffer pool.Modifier and TypeFieldDescriptionstatic final BufferCollector
<? extends ManagedBuffer<?>> BufferCollector.NOOP_COLLECTOR
A predefined buffer collector that does nothing when the managed buffer is no longer used.Modifier and TypeMethodDescriptionManagedBuffer.manager()
Return the buffer’s manager.static <T extends ManagedBuffer<?>>
BufferCollector<T> BufferCollector.noopCollector()
A type-safe way to get theNOOP_COLLECTOR
.ModifierConstructorDescriptionManagedBuffer
(T buffer, BufferCollector<ManagedBuffer<T>> manager) Create a new Managed buffer, backed by the given buffer, with a lock count of one.ModifierConstructorDescriptionManagedBufferPool
(BiFunction<T, BufferCollector<W>, W> wrapper, Supplier<T> bufferFactory, int buffers) Create a pool that keeps up to the given number of (wrapped) buffers in the pool and also uses that number as upper limit.ManagedBufferPool
(BiFunction<T, BufferCollector<W>, W> wrapper, Supplier<T> bufferFactory, int lowerThreshold, int upperLimit) Create a pool that contains a varying number of (wrapped) buffers.