且构网

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

客户端 - 服务器ObjectInputStream错误

更新时间:2021-11-20 21:41:05

ObjectInputStream documentation

创建从指定的InputStream读取的ObjectInputStream。从流中读取串行化流头并进行验证。这个构造函数将阻塞,直到相应的ObjectOutputStream写入和刷新头。

Creates an ObjectInputStream that reads from the specified InputStream. A serialization stream header is read from the stream and verified. This constructor will block until the corresponding ObjectOutputStream has written and flushed the header.

如果引用,调用将阻塞,直到标题可以读取。您需要有一些数据从套接字到达,才能继续此呼叫。

As quoted the call will block until the header can be read. You need to have some data to arrive from the socket before this call can continue.