Why is my BufferedReader reading text that dosn't exit in the given file?

后端 未结 3 575
渐次进展
渐次进展 2021-01-25 23:06

I am using a BufferedReader to read details from a file which are stored as bytes, I am then converting the bytes into text and splitting it into an

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-25 23:42

    white spaces may cos this error. try to trim() the input line while reading line,

    like,

    line = bufferedReader.readLine().trim();
    

提交回复
热议问题