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

16 lines
323 B
Kotlin
Vendored

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