LineNumberInputStream

производит подсчет, сколько строк было считано

class java.io.LineNumberInputStream

Наследник java.io.InputStream