我正在尝试使用 Buffered Writer 将一些数据写入文件。我需要创建一个带有时间戳和行号的索引文件。为此,我需要输出流写入的行号。
能否请您提出一些实现此目的的方法
最佳答案
每当你向文件写入一行时增加一个计数器。
关于Java : I want to get the line number of the line where output stream has written the data in a file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7433032/