This question already has answers here:
When will an EOFException occur in JAVA's streams

(5个答案)


7天前关闭。





所以我收到一条EOFException与以下消息:

java.io.EOFException: \n not found: size=1 content=0d...


以及发生异常的代码或行:

   while ((line = reader.readLine()) != null) {
       stringBuilder.append(line);
   }

最佳答案

如果流在读取所有字节之前结束,则抛出EOFException

关于java - 在AsynTask中获取EOFException(Android Studio),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/62352250/

10-12 03:51