STANDARD_BUFFER_SIZE_BYTES
Constructor and Description |
---|
LruArrayPool() |
LruArrayPool(int maxSize)
Constructor for a new pool.
|
Modifier and Type | Method and Description |
---|---|
void |
clearMemory()
Clears all arrays from the pool.
|
<T> T |
get(int size,
Class<T> arrayClass)
Returns a non-null array of the given type with a length >= to the given size.
|
<T> T |
getExact(int size,
Class<T> arrayClass)
Returns a non-null array of the given type with a length exactly equal to the given size.
|
<T> void |
put(T array)
Optionally adds the given array of the given type to the pool.
|
<T> void |
put(T array,
Class<T> arrayClass)
Deprecated.
|
void |
trimMemory(int level)
Trims the size to the appropriate level.
|
public LruArrayPool()
public LruArrayPool(int maxSize)
maxSize
- The maximum size in integers of the pool.@Deprecated public <T> void put(T array, Class<T> arrayClass)
ArrayPool
Arrays may be ignored, for example if the array is larger than the maximum size of the pool.
public <T> void put(T array)
ArrayPool
Arrays may be ignored, for example if the array is larger than the maximum size of the pool.
public <T> T getExact(int size, Class<T> arrayClass)
ArrayPool
If an array of the given size isn't in the pool, a new one will be allocated.
This class makes no guarantees about the contents of the returned array.
getExact
in interface ArrayPool
ArrayPool.get(int, Class)
public <T> T get(int size, Class<T> arrayClass)
ArrayPool
If an array of the given size isn't in the pool, a new one will be allocated.
This class makes no guarantees about the contents of the returned array.
get
in interface ArrayPool
ArrayPool.getExact(int, Class)
public void clearMemory()
ArrayPool
clearMemory
in interface ArrayPool
public void trimMemory(int level)
ArrayPool
trimMemory
in interface ArrayPool
level
- A trim specified in ComponentCallbacks2
.