|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.util.ByteCache
public final class ByteCache
Cache the objects frequently used to reduce memory churn. The ByteArray should be held onto as long as the data referenced in it is needed.
Method Summary | |
---|---|
ByteArray |
acquire()
Get the next available structure, either from the cache or a brand new one |
static ByteCache |
getInstance(int cacheSize,
int size)
Get a cache responsible for objects of the given size |
void |
release(ByteArray entry)
Put this structure back onto the available cache for reuse |
void |
release(ByteArray entry,
boolean shouldZero)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ByteCache getInstance(int cacheSize, int size)
cacheSize
- how large we want the cache to grow before using on
demand allocationsize
- how large should the objects cached be?public final ByteArray acquire()
public final void release(ByteArray entry)
public final void release(ByteArray entry, boolean shouldZero)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |