public void lectureFichier(String filename) { BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(filename)); String line = null; //si fin de fichier, readline renvoie null while ((line = reader.readLine()) != null) { System.out.println(line); } } catch (FileNotFoundException e) { System.err.println(e.getMessage()); } catch (IOException e) { System.err.println(e.getMessage()); } finally { if (reader != null) { try { reader.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } } }