DataInputStream dis = null; try { dis = new DataInputStream(new FileInputStream("file.txt")); BufferedReader br = new BufferedReader(new InputStreamReader(dis)); String line; while ((line = br.readLine()) != null) { System.out.println(line); } } catch (Exception e) { System.err.println(e.getMessage()); }finally{ try { dis.close(); } catch (IOException ex) {} }
No comments:
Post a Comment