Created
August 18, 2011 04:27
-
-
Save paulfryzel/1153293 to your computer and use it in GitHub Desktop.
Ensure IO is properly closed
This file contains 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
def convert(command: String, fileIn: String, fileOut: String): Unit = { | |
val input = new FileInputStream(fileIn) | |
val output = new FileOutputStream(fileOut) | |
val converter = new MagickConverter("(no name)", command) | |
try { | |
converter.process(input, output) | |
} finally { | |
input.close() | |
output.close() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment