| 1 | import java.io.*; |
| 2 | import java.util.*; |
| 3 | |
| 4 | public class textstats { |
| 5 | |
| 6 | public static void main(String[] Args) { |
| 7 | File file = new File("lipsum.txt"); |
| 8 | |
| 9 | try { |
| 10 | |
| 11 | FileInputStream fis = new FileInputStream(file); |
| 12 | BufferedInputStream bis = new BufferedInputStream(fis); |
| 13 | //DataInputStream dis = new DataInputStream(bis); |
| 14 | Scanner sc = new Scanner(bis); |
| 15 | |
| 16 | while (sc.hasNext()) { |
| 17 | //System.out.println(dis.readLine()); |
| 18 | System.out.println(sc.next()); |
| 19 | } |
| 20 | |
| 21 | fis.close(); |
| 22 | bis.close(); |
| 23 | //dis.close(); |
| 24 | |
| 25 | } catch(Exception e) { |
| 26 | e.printStackTrace(); |
| 27 | } |
| 28 | } |
| 29 | } |