package loc;

import java.io.*;
import java.nio.file.Path;

public class LineCounter {
    public static final int defaultBufferSize = 1024;

    public static int count(Path filePath, int bufferSize) throws IOException {
        try (InputStream is = new BufferedInputStream(new FileInputStream(filePath.toFile()))) {
            boolean empty = true;
            byte bytes[] = new byte[bufferSize];
            int readChars;
            int count = 1;
            while ((readChars = is.read(bytes)) != -1) {
                empty = false;
                for (int i = 0; i < readChars; ++i) {
                    if (bytes[i] == '\n') {
                        ++count;
                    }
                }
            }
            if (empty) {
                return 0;
            } else {
                return count;
            }
        }
    }

    public static int count(Path filePath) throws IOException {
        return count(filePath, defaultBufferSize);
    }
}

@@ -80,20 +80,17 @@
 unter %7B%0A
-    
+%09
 public s
@@ -132,20 +132,17 @@
  1024;%0A%0A
-    
+%09
 public s
@@ -846,19 +846,13 @@
   %7D%0A
-    %7D%0A%0A    
+%09%7D%0A%0A%09
 publ
@@ -907,24 +907,18 @@
 ption %7B%0A
-        
+%09%09
 return c
@@ -952,16 +952,13 @@
 rSize);%0A
-    
+%09
 %7D%0A%7D%0A

Fix indents