- java.lang.Object
-
- ch.bind.philib.pool.buffer.ByteArrayPool
-
-
Constructor Summary
Constructors Constructor Description ByteArrayPool(Pool<byte[]> backend)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()instructs the pool to destroy all pooled objects.static ByteArrayPoolcreate(int bufferSize, int maxEntries)static ByteArrayPoolcreate(int bufferSize, int maxEntries, int concurrencyLevel)intgetNumPooled()PoolStatsgetPoolStats()voidrecycle(byte[] value)Recycles an object which might be reused.byte[]take()Take an object from the object-pool.
-
-
-
Constructor Detail
-
ByteArrayPool
public ByteArrayPool(Pool<byte[]> backend)
-
-
Method Detail
-
take
public final byte[] take()
Description copied from interface:PoolTake an object from the object-pool.
-
recycle
public final void recycle(byte[] value)
Description copied from interface:PoolRecycles an object which might be reused. The caller must not use this object after calling this method.
-
getPoolStats
public final PoolStats getPoolStats()
- Specified by:
getPoolStatsin interfacePool<byte[]>- Returns:
- This pool's statistics object. Calls to this pool's methods are visible to successive calls to this statics-object's methods.
-
getNumPooled
public int getNumPooled()
- Specified by:
getNumPooledin interfacePool<byte[]>- Returns:
- The number of currently pooled objects.
-
clear
public void clear()
Description copied from interface:Poolinstructs the pool to destroy all pooled objects.
-
create
public static ByteArrayPool create(int bufferSize, int maxEntries)
-
create
public static ByteArrayPool create(int bufferSize, int maxEntries, int concurrencyLevel)
-
-