16 lines
330 B
Kotlin
16 lines
330 B
Kotlin
import java.io.*
|
|
|
|
public class C {
|
|
fun foo() {
|
|
try {
|
|
FileInputStream("foo").use { stream ->
|
|
// reading something
|
|
val c = stream.read()
|
|
System.out.println(c)
|
|
}
|
|
} catch (e: IOException) {
|
|
System.out.println(e)
|
|
}
|
|
|
|
}
|
|
} |