use

inline fun <R> TypedArray.use(block: (TypedArray) -> R): R

Calls the given function block with this TypedArray as its argument, then recycles this TypedArray.