Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
FileInputStream stream = null;
BufferedReader bufRead = null;
String line;
try {
  stream = new FileInputStream(fileName);
  bufFread = new BufferedReader(stream);
  while((line=bufRead.readLine())!=null) {
	sendLine(line);
     }
} catch (IOException e) { }
  catch {FileNotFoundException e) { }
  finally {
   try {
    if(bufRead != null) {
      bufRead.close();
    }
   }
   finally {
       if(stream != null) {
         stream.close();
       }
   }
}

Risk Assessment

Acquiring non-memory system resources and not releasing them explicitly might lead to resource exhaustion.

...