70185ba2a6
#KT-4194 Fixed #KT-31881 Fixed #KT-34673 Fixed #KT-35152 Fixed
17 lines
391 B
Kotlin
Vendored
17 lines
391 B
Kotlin
Vendored
import java.io.ByteArrayInputStream
|
|
import java.io.IOException
|
|
|
|
class C {
|
|
@Throws(IOException::class)
|
|
fun foo() {
|
|
try {
|
|
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
|
// reading something
|
|
val c = stream.read()
|
|
println(c)
|
|
}
|
|
} finally {
|
|
// dispose something else
|
|
}
|
|
}
|
|
} |