In my Kotlin project in folder src/resources/
I has file pairs_ids.txt
.
This is a property file:
key=value
The count of all lines are 1389.
Here code that read content of this file line by line.
open class AppStarter : Application<AppConfig>() {
override fun getName() = "stats"
override fun run(configuration: AppConfig?, environment: Environment?) {
val logger = LoggerFactory.getLogger(this::class.java)
val inputStream = javaClass.getResourceAsStream("/pairs_ids.txt")
val isr = InputStreamReader(inputStream)
val br = BufferedReader(isr)
for (line in br.lines()) {
logger.info("current_line = " + line)
}
br.close()
isr.close()
inputStream.close()
}
}
fun main(args: Array<String>) {
AppStarter().run(*args)
}
The problem is that count of current_line is every time different.
Start project - the count of current_line is 803.
Start again project - the count of current_line is 1140.
Why every time the count is different and not equal to 1389?