Package ibis.cashmere.constellation
Class BufferCache
- java.lang.Object
- 
- ibis.cashmere.constellation.BufferCache
 
- 
 public class BufferCache extends java.lang.ObjectA wrapper forByteBufferCache.
- 
- 
Constructor SummaryConstructors Constructor Description BufferCache()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static BuffergetBuffer(int sizeBuffer, boolean needsClearing)Obtains aBufferof the specified size.static voidinitializeBuffers(int sizeBuffer, int nrBuffers)Initializes the buffer cache with the specified number of buffers of the specified size.static voidmakeAvailableBuffer(Buffer b)Make the specifiedBufferavailable for use, that is, append it to the list of available buffers.
 
- 
- 
- 
Method Detail- 
makeAvailableBufferpublic static void makeAvailableBuffer(Buffer b) Make the specifiedBufferavailable for use, that is, append it to the list of available buffers.- Parameters:
- b- a- Buffervalue
 
 - 
getBufferpublic static Buffer getBuffer(int sizeBuffer, boolean needsClearing) Obtains aBufferof the specified size. If one cannot be found in the cache, a new one is allocated. If it needs to be clear(ed), the needsClearing flag should be set to true.- Parameters:
- sizeBuffer- the size of the- Bufferto be obtained
- needsClearing- whether the- Bufferneeds to be cleared
- Returns:
- the obtained Buffer
 
 - 
initializeBufferspublic static void initializeBuffers(int sizeBuffer, int nrBuffers)Initializes the buffer cache with the specified number of buffers of the specified size.- Parameters:
- sizeBuffer- the size of the buffers
- nrBuffers- the number of buffers that need to be initialized
 
 
- 
 
-