java.io.EOFException이 나타나는 이유를 알 수 없습니다. 내가 서버에서 이진 스트림을 얻은 후에 파일을 작성하고 싶습니다.소켓에서 읽을 때 java.io.EOFException
여기 내 코드의
inputStream = new DataInputStream(new BufferedInputStream(connection.getInputStream()));
FileOutputStream fos = new FileOutputStream("D:/Apendo API resumable download.txt");
byte b = inputStream.readByte();
while(b != -1){
fos.write(b);
b = inputStream.readByte();
}
fos.close();
스택 추적
java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at HttpRequestJSON.JSONRequest.sendRequest(JSONRequest.java:64)
at HttpRequestJSON.Main.main(Main.java:56)
어디에서 예외가 있습니까? –
b = inputStream.readByte(); in (b! = -1) – Yusuf1494
Err, 실제로 파일을 * 읽으려고 할 때. – EJP