Package net.i2p.util
Class SimpleByteCache
java.lang.Object
net.i2p.util.SimpleByteCache
Like ByteCache but works directly with byte arrays, not ByteArrays.
 These are designed to be small caches, so there's no cleaner task
 like there is in ByteCache. And we don't zero out the arrays here.
 Only the static methods are public here.
- Since:
- 0.8.3
- 
Method SummaryModifier and TypeMethodDescriptionstatic byte[]acquire(int size) Get the next available array, either from the cache or a brand new onestatic voidclearAll()Clear everything (memory pressure)static SimpleByteCachegetInstance(int size) Get a cache responsible for arrays of the given sizestatic SimpleByteCachegetInstance(int cacheSize, int size) Get a cache responsible for objects of the given sizestatic voidrelease(byte[] entry) Put this array back onto the available cache for reuse
- 
Method Details- 
getInstanceGet a cache responsible for arrays of the given size- Parameters:
- size- how large should the objects cached be?
 
- 
getInstanceGet a cache responsible for objects of the given size- Parameters:
- cacheSize- how large we want the cache to grow (number of objects, NOT memory size) before discarding released objects.
- size- how large should the objects cached be?
 
- 
clearAllpublic static void clearAll()Clear everything (memory pressure)
- 
acquirepublic static byte[] acquire(int size) Get the next available array, either from the cache or a brand new one
- 
releasepublic static void release(byte[] entry) Put this array back onto the available cache for reuse
 
-