미친 듯이 들리 겠지만 파일에서 읽는 중이고 파일의 첫 번째 줄을 건너 뛰는 것처럼 보입니다.파일 참고의 첫 번째 줄이 BufferedReader로 읽히는 이유는 무엇입니까?
무슨 일입니까?
private void loadFile(String fileNPath)
{
StringBuilder currentFileContents = new StringBuilder();
CharBuffer contentsBuffer = CharBuffer.allocate(65536);
int status=0;
try
{
BufferedReader in = new BufferedReader(new FileReader(fileNPath));
while(status!=-1)
{
status=in.read(contentsBuffer);
currentFileContents.append(contentsBuffer);
contentsBuffer.clear();
}
System.out.println(currentFileContents.toString());
}
catch(FileNotFoundException n)
{
//Should be imposible
}
catch(IOException n)
{
n.printStackTrace(System.out);
}
}
그것은해야 뭔가 내가 이상 찾고 : 여기
는 소스입니다.나는 정확한 소스를 복사하여 붙여 넣었으므로 이런 일이 발생하기를 바랍니다.
감사합니다, caalip
저는 파일의 두 번째 줄만 가져옵니다. –