|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.util.SimpleByteCache
public final class 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.
Method Summary | |
---|---|
static byte[] |
acquire(int size)
Get the next available array, either from the cache or a brand new one |
static void |
clearAll()
Clear everything (memory pressure) |
static SimpleByteCache |
getInstance(int size)
Get a cache responsible for arrays of the given size |
static SimpleByteCache |
getInstance(int cacheSize,
int size)
Get a cache responsible for objects of the given size |
static void |
release(byte[] entry)
Put this array back onto the available cache for reuse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SimpleByteCache getInstance(int size)
size
- how large should the objects cached be?public static SimpleByteCache getInstance(int cacheSize, int size)
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?public static void clearAll()
public static byte[] acquire(int size)
public static void release(byte[] entry)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |