Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int sizeRowFile(String path) {
- int sizeI;
- boolean isIncorrect;
- Scanner scanner = null;
- try {
- BufferedReader bufferedReader = new BufferedReader(new FileReader(path));
- } catch (FileNotFoundException e) {
- System.out.println("Ошибка открытия файла");
- }
- sizeI = 0;
- System.out.println("Считывание размера строк......");
- do {
- isIncorrect = false;
- try {
- scanner = new Scanner(new File(path));
- sizeI = Integer.parseInt(bufferedReader.readLine());
- } catch (IOException e) {
- System.err.println("Ошибка при чтении файла!");
- isIncorrect = true;
- }
- } while (isIncorrect);
- scanner.close();
- return sizeI;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement