---------------------------------------------------------------------------------------------------------------------------------------------------------------
转载请声明:本文来自 https://blog.csdn.net/shijianduan1/article/details/82586111
---------------------------------------------------------------------------------------------------------------------------------------------------------------
java.net.ProtocolException: unexpected end of stream
08-31 13:32:58.753 W/System.err( 4210): at okhttp3.internal.http.Http1xStream$FixedLengthSource.read(Http1xStream.java:380)
08-31 13:32:58.753 W/System.err( 4210): at okio.RealBufferedSource$1.read(RealBufferedSource.java:409)
08-31 13:32:58.753 W/System.err( 4210): at java.io.BufferedInputStream.read(BufferedInputStream.java:290)
08-31 13:32:58.753 W/System.err( 4210): at com.lzy.okserver.download.DownloadTask.download(DownloadTask.java:237)
08-31 13:32:58.753 W/System.err( 4210): at com.lzy.okserver.download.DownloadTask.doInBackground(DownloadTask.java:188)
08-31 13:32:58.753 W/System.err( 4210): at com.lzy.okserver.download.DownloadTask.doInBackground(DownloadTask.java:31)
08-31 13:32:58.753 W/System.err( 4210): at com.lzy.okserver.task.PriorityAsyncTask$1.call(PriorityAsyncTask.java:69)
08-31 13:32:58.753 W/System.err( 4210): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
08-31 13:32:58.753 W/System.err( 4210): at com.lzy.okserver.task.PriorityRunnable.run(PriorityRunnable.java:20)
08-31 13:32:58.753 W/System.err( 4210): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
08-31 13:32:58.753 W/System.err( 4210): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
08-31 13:32:58.753 W/System.err( 4210): at java.lang.Thread.run(Thread.java:818)
分析:
java.net.ProtocolException: unexpected end of stream 流意外结束
出现这种错误时不要惊慌,这个原因是因为网络延时的问题,换而言之就是你公司或者你手机的wifi网络不好啦,如果你手机是4G,切换4G试试就知道了。 就不会出现这种状况
解决:
待解决中, 如果你已解决,恳请提供下解决方法