Files
kotlin-fork/j2k/testData/fileOrElement/tryWithResource/WithFinally.kt
T
2015-09-18 15:44:18 +03:00

16 lines
354 B
Kotlin
Vendored

import java.io.*
class C {
@Throws(IOException::class)
internal fun foo() {
try {
ByteArrayInputStream(ByteArray(10)).use { stream ->
// reading something
val c = stream.read()
println(c)
}
} finally {
// dispose something else
}
}
}