且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

java.net.ProtocolException:流意外结束

更新时间:2022-03-13 16:58:35

This可以帮助你:

这异常是由FixedLengthInputStream抛出时所期望的字节数(通常在响应的内容长度的头设置)比在响应中的实际数据更大。检查内容长度的头是正确的。 (如果你正在为提供内容长度自己的价值,确保它是正确的。)

That exception is thrown by FixedLengthInputStream when the expected number of bytes (usually set in the content-length header of the response) is larger than the actual data in the response. Check that the content-length header is correct. (If you're supplying your own value for the content length, make sure it is correct.)

这将有助于你看到code,设置了输入流。

It would help to see your code that sets up the input stream.