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)