내 코드가 txt 파일의 첫 줄을 건너 뛰는 이유는 아닙니다. 때문에 첫 번째 라인을 읽고 가서 파일 리더에게 첫 번째 if(br.readLine() == null){
이 곳의Java : 왜 텍스트 판독기가 두 번째 줄의 텍스트 읽기를 시작하는지 알지 못합니다.
InputStream input = event.getFile().getInputstream();
BufferedReader br = new BufferedReader(new InputStreamReader(input));
String red;
int brojac = 0;
String content = "";
String billNumber = "840000000096362741";
if(br.readLine() == null){
throw new WrongFileException("Format fajla nije dobar!");
}
while ((red = br.readLine()) != null) {
content = red;
treasuryStatHeader.setTshStatFileContent(content);
System.out.println(content.substring(0, 20));
brojac++;
System.out.println(brojac + " BROJACCCCCCC");
if (brojac == 1) {
.
.
.
} else {...}
우리는 텍스트 파일을 볼 수 있을까요? – user6248190
br.readLine()을 한 번 호출하기 전에 인쇄하지 않을 것입니다. –
InputStream을 닫고 있습니까? – El0din