public class TestLineNumberReader {
public static void main(String[] args) {
try {
LineNumberReader reader = new LineNumberReader(new InputStreamReader(new FileInputStream(new File("D:\\work\\properties\\lineNumber.txt"))));
String line = null;
try {
while((line=reader.readLine()) != null){
System.out.println("line num:"+reader.getLineNumber() +" content:"+line);
}
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
LineNumberReader reader = new LineNumberReader(Reader arg0);