STANDARD_BUFFER_SIZE_BYTES
构造器和说明 |
---|
LruArrayPool() |
LruArrayPool(int maxSize)
Constructor for a new pool.
|
限定符和类型 | 方法和说明 |
---|---|
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)
已过时。
|
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
在接口中 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
在接口中 ArrayPool
ArrayPool.getExact(int, Class)
public void clearMemory()
ArrayPool
clearMemory
在接口中 ArrayPool
public void trimMemory(int level)
ArrayPool
trimMemory
在接口中 ArrayPool
level
- A trim specified in ComponentCallbacks2
.