I was wondering, whether is there any need for me to close the InputStream, after I close the reader?
try {
inputStream = new java.io.FileInputStream(file);
reader = new InputStreamReader(inputStream, Charset.forName("UTF-8"));
} catch (Exception exp) {
log.error(null, exp);
} finally {
if (false == close(reader)) {
return null;
}
// Do I need to close inputStream as well?
if (false == close(inputStream)) {
return null;
}
}
if (!close(reader)
and notif (false == close(reader))
– Gamalif (!check) { thing(); return; } otherthing();
toif (check) { otherthing() } else { thing(); }
. – Claritaclarityreturn
infinally
? Arghhhhhhhhhhhhhhhh!!! – Claritaclarityreturn
s,break
s andcontinue
s. And it causes compiler lint warnings. (The C# dialect of Java-like languages gives errors, IIRC.) – ClaritaclarityFileReader
instead of anInputStreamReader
reading aFileInputStream
. – Oink