Created
October 25, 2018 00:32
-
-
Save nwillc/ad347032f83b5124ab21c2bb85b04c86 to your computer and use it in GitHub Desktop.
Use with multiple resources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
FileReader("input.txt").use { reader -> | |
FileWriter("output.txt").use { writer -> | |
// Use the input and output | |
} | |
} | |
} catch (e: FileNotFoundException) { | |
// Handle possible exception | |
} catch (e2: IOException) { | |
// Handle another exception | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment