1 package net.sf.jpkgmk.util;
2
3 import java.io.BufferedReader;
4 import java.io.IOException;
5 import java.io.Reader;
6
7
8
9
10
11
12
13
14 public class LineCountingReader extends BufferedReader
15 {
16 private int lineNumber = 0;
17
18
19 public LineCountingReader(Reader reader) {
20 super(reader);
21 }
22
23
24 @Override
25 public String readLine() throws IOException {
26 String result = super.readLine();
27 lineNumber++;
28 return result;
29 }
30
31 public int currentLineNumber() {
32 return this.lineNumber;
33 }
34 }