add

fun <T : AutoCloseable> add(autoCloseable: T): T

Adds a AutoCloseable that will be called when the CompositeAutoCloseable's close is called.

Return

added AutoCloseable


inline fun add(crossinline autoCloseable: () -> Unit): AutoCloseable

Adds lambda type AutoCloseable that will be called when the CompositeAutoCloseable's close is called.